Introducing jQuery SpicySelect
I recently worked on a project in which the client wanted to have custom styled select boxes. Long story short, I found an obscure jQuery plugin that claimed to do it but was not compatible with Rails at all and was missing some functionality, like the support of option groups, and did not perform well on large lists. Needless to say, I completely reengineered the plugin and re-released it on github under a different name, SpicySelect. To use it, all you need to do is call on a normal select written out by your app:
$("select").spicyselect();
The plugin will hide your select and write out a DOM structure of ol/li elements wrapped in a div. It will carry over any classes you had on your select or options and wire up the events so that the mask works similarly to the underlying select. Any time the mask's selected option is changed, the underlying select's option is also changed and the change event is fired. That allows you to write code keying off the select's change event like you normally would and the mask will not interfere.
I put a demo up, although it has not been styled yet. I am hoping to get that done over the course of the next week or so. I also published a quick link to the spec.
Pertinent URLs:
I hope you find the plugin useful. If you have any comments, issues, feature requests, bugs, etc, please don't hesitate to email me!