jquery.customSelect
jquery.customSelect copied to clipboard
Added callbacks and new iconClass parameter.
- Added two new callbacks, init() & changed()
- Added new option "iconClass", which will add another nested span tag with the defined classname. This makes working with icon fonts easier (like Font Awesome).
@objectivehtml I'm curious what the preferred method would be to populate the icon into the new span? Do you just use :before ? And if so, why do you need an addition span to do so?
I have all this working already. I need to recommit my changes so you can see all the stuff I did. I made a pull request, and then decided to refactor my work a bit. I think with these new callback methods and new params for the icon node, it works great.
I use Font Awesome for my icons. So I typically do something like this:
<i class="icon-search"></i>
or
<span class="icon-search"></span>
So with your plugin, I just added a param to append a new icon node and I could apply any class to it. I bet there were other ways to do it, but this was easiest/quickest for me to implement.
I just pushed my latest changes.
Here is a basic usage example:
(function($) {
$(document).ready(function() {
$('.custom-select').customSelect({
iconClass: 'icon-sort-down'
});
});
}(jQuery));