Selectbox is a simple and flexible jQuery plugin that helps you fully style your `<select>` elements, and keeps them readable and accessible to all.
elements, and keeps them readable and accessible to all.``js
// CommonJS
var $ = require('jquery');
require('selectbox');
$('select').selectbox();
// AMD
require(['jquery', 'selectbox'], function($) {
$('select').selectbox();
});
// Global (include both jquery and selectbox JS files in your html)
$('select').selectbox();
`
You can then style the generated elements (see the examples for basic styling).
#### html (boolean)
default : false
You can switch it to true to insert the options' labels and option groups' labels as html instead of plain text (be careful of injections !). You can add a data-original-label attribute on the options to use as a new label.
#### onParseOption (function)
A function that takes the option jQuery object as a parameter and must return a string that will be injected as the option or option group label.
#### width (string)
default : 'min-width'
Tells selectbox which CSS property it should use to set the select width : min-width or width. Use "manual" if you want to set the width with CSS.
#### isResponsive (boolean)
default : true
Tells selectbox to switch between two rendering modes depending on the viewport's width.
#### mobileBreakpoint (int)
default : 768
Under this viewport's width, selectbox will switch to mobile display of the options' list.
#### desktopAnimation (string|function)
default : 'toggle'
The animation function to use when selectbox is in desktop mode. (see animation section).
#### mobileAnimation (string|function)
default : 'mobile'
The animation function to use when selectbox is in mobile mode. (see animation section).
#### optionsTitleLabel (string)
default : null
If specified, it will be displayed on top of the options' list. If not, selectbox will retrieve the
#### cancelBtnLabel (string)
default : 'Cancel'
The label of the cancel button that closes the options list.
#### containerClass (string)
default : 'selectbox'
#### buttonClass (string)
default : 'selectbox-button'
#### listBoxClass (string)
default : 'selectbox-list-box'
#### listClass (string)
default : 'selectbox-list'
#### listItemClass (string)
default : 'selectbox-list-item'
#### groupLabelClass (string)
default : 'selectbox-group-label'
#### groupItemClass (string)
default : 'selectbox-group-item'
#### dividerClass (string)
default : 'selectbox-list-divider'
#### optionsTitleClass (string)
default : 'selectbox-items-title'
#### cancelBtnClass (string)
default : 'selectbox-cancel'
method.`js
// with the plugin
$element.selectbox('method_name', {params});// with the data
var api = $element.data('selectbox');
api.method_name(params);
`$3
#### open()
Opens the options list.
#### close()
Closes the options list.
#### setValue(value)
Sets the value of the select.
#### disable()
Disables the select.
#### enable()
Enables the select.
#### isDisabled() => (boolean)
Returns if the select is disabled.
#### refresh()
Updates all options and option groups. To call when the source