jQuery.DropdownReplacement
jQuery.DropdownReplacement demos. Last touched 3/11/10
- This script requires the scrollTo plugin.
script source in SVN
Features:
Looks like a native windows XP select, can be skinned.
Seeks to option when you type
Use arrow keys to navigate options
Supports tab index and tabbing
Build a widget from an input and JSON list of options
Build a widget from an input and a prewritten options html element
Build a widget from an existing select
Multiple selects can share an options body, thus you can reduce page size.
Lots of other options
Demos
options built from json object, 3 selects share a single options body:
options built from json object, select resized to fit options body:
options built from json object, showing 10 items:
options are prebuilt html:
native select box for comparison:
i am a native selectbox
breal select2
selected val
creal select4
dreal select5
native select box converted into widget:
i am not native selectbox
breal select2
selected val
creal select4
dreal select5
i am a native selectbox
breal select2
selected val
creal select4
dreal select5
Cakes
Oranges
Meat
Cheese
Cat
Apple
Chicken Pot Pie
for version 0.5 testing:
Volvo
Saab
With 4 Wheels
With 3 Wheels
Mercedes
Audi
To do for 0.4:
show dropdown within window bounds
support for transforming a native dropdown into widget
support for pre-built options body
formalize handling of onSelect
reconcile TODOs
arrow scroll by holding down key
test
To do for 0.5:
some better docs
throw exceptions when bad stuff happens
deal with text-overflow on non-ie
programatically retrieve option's value from DOM/input
try to get rid of optionsWidthOffset
optgroup support
test
more food for thought:
http://stackoverflow.com/questions/306097/is-there-a-fully-functional-dropdown-replacement-for-html-select-that-works-in-ie