CARVIEW |
rmm5t / jquery-flexselect
- Source
- Commits
- Network (2)
- Issues (2)
- Downloads (12)
- Graphs
-
Branch:
master
click here to add a description
click here to add a homepage
name | age | message | |
---|---|---|---|
![]() |
.gitignore | Mon Feb 16 15:01:00 -0800 2009 | ignoring personal notes file [rmm5t] |
![]() |
README.markdown | Tue Aug 25 13:05:11 -0700 2009 | Cleanup of tests and docs [rmm5t] |
![]() |
Rakefile | Mon Mar 16 09:41:44 -0700 2009 | Added some rake task descriptions [rmm5t] |
![]() |
flexselect.css | Mon Mar 16 09:36:21 -0700 2009 | Dropdown now automatically adds a scroll bar on... [rmm5t] |
![]() |
index.html | Fri Jan 15 10:33:39 -0800 2010 | Upped to jQuery 1.4 [rmm5t] |
![]() |
jquery.flexselect.js | Mon Mar 16 09:35:40 -0700 2009 | Fixed mouse behavior when a scroll bar is added... [rmm5t] |
![]() |
liquidmetal.js | Mon Feb 09 14:35:33 -0800 2009 | Removed the notion of keeping liquidmetal in a ... [rmm5t] |
![]() |
test.html | Fri Jan 15 10:33:39 -0800 2010 | Upped to jQuery 1.4 [rmm5t] |
flexselect: a jQuery plugin
FlexSelect is a jQuery plugin that turns select boxes into flex-matching incremental-finding controls.
Flex matching a few keystrokes against longer strings is a boon in productivity for typists. Applications like Quicksilver, LaunchBar, and Launchy have made this method of keyboard entry a popular one. It's time to bring this same functionality to web controls. FlexSelect does that for select boxes.
Usage
First, load jQuery, the LiquidMetal scoring algorithm, and the plugin:
<script src="jquery.min.js" type="text/javascript"></script>
<script src="liquidmetal.js" type="text/javascript"></script>
<script src="jquery.flexselect.js" type="text/javascript"></script>
Now, let's attach it to your select boxes on DOM ready:
<pre>
jQuery(document).ready(function() {
jQuery("select.flexselect).flexselect();
});
</pre>
This will turn all select elements with a class
of flexselect
:
<select class="flexselect" id="president name="president">
<option value="1">George Washington</option>
<option value="2">John Adams</option>
<option value="3">Thomas Jefferson</option>
...
</select>
into a bad-ass autocompleting text box with flex matching support.
For more usage and examples: https://rmm5t.github.com/jquery-flexselect/
Inspired by:
- jQuery.quickselect by Daniel Parker
- MooTools Select Autocompleter by Kyle Neath
- Live Search with QuickSilver Style (for jQuery) by John Nunemaker
- jQuery LiveSearch by John Resig
Todo
- Review the "picked" logic
- Fix selectedIndex when mouse happens to sit over dropdown during incremental find (perhaps unbind mouseover during filtering until a mousemove).
- Add templating support for matched list output.
- Add highlighting of matched characters in the results.
- Consider support for optgroup tags
Author
Other
Copyright (c) 2009, Ryan McGeary (ryanonjavascript -[at]- mcgeary [dot] org)