I need a simple string filter for a drop-down menu that highlights matched text.
Here's an example of such a module in use in Gmail's UI:
I'm assuming there's a plugin for 开发者_JAVA技巧something like this, though I'm also thinking it could be simple enough to roll my own. Any ideas?
Have a look into the jQuery UI AutoComplete widget: http://jqueryui.com/demos/autocomplete/
I managed to tweak this code a little to get something working that's very performant and really slick: http://kilianvalkhof.com/2010/javascript/how-to-build-a-fast-simple-list-filter-with-jquery/
Here's the final result already live on Goals:
精彩评论