jquery select expander - make select dom by json file
Usage
Download and copy the plugin + json data into your js/
folder. (make sure the data/
folder is in the same directory as the plugin)
Drop in the plugin after your jQuery include:
<script src="js/jquery.js"></script>
<script src="js/jquery-select-expander.min.js"></script>
Call the plugin after the DOM is ready:
$(document).ready(function(){
$('select').selectExpander();
});
Specify the options for your select elements using the data-from
attribute:
<select data-from="country"></select>
The data-from
attribute specifies the name of the json file contained in the data/
folder. This plugin comes with json files for states and countries out of the box. Feel free to modify them as you please.
If you want to add your own json file, follow this format:
{
"<option-value>": "<option-label>",
"<option-value>": "<option-label>",
"<option-value>": "<option-label>"
}
Create a useful set of options? Please make a pull request to add it to my collection!
You might also like
Tags
accordion accordion menu animation navigation animation navigation menu carousel checkbox inputs css3 css3 menu css3 navigation date picker dialog drag drop drop down menu drop down navigation menu elastic navigation form form validation gallery glide navigation horizontal navigation menu hover effect image gallery image hover image lightbox image scroller image slideshow multi-level navigation menus rating select dependent select list slide image slider menu stylish form table tabs text effect text scroller tooltips tree menu vertical navigation menu