jquery.switcher v1.2.3
Custom checkbox / radio button in jquery
see live example here
How to get it
git clone git://github.com/djanix/jquery.switcher.git
or
bower install jquery.switcher
Browser support
Firefox, Chrome, Safari, iOS, Android, IE9+
What to include in your html
How to initialize the plugin
;
Params
Param | Default value | Info |
---|---|---|
style | 'default' | class added to the html element to change the input visual. Right now there's only 'default' and 'short' |
selected | false | if the input is checked or not. If nothing is specified, it will take the input checked value |
language | 'en' | default language used for the yes/no texts |
disabled | false | if the input is disabled |
copy | {obj} | json object with all the languages. By default, it only contain fr/en |
You can change the parameters in the javascript when instantiating the plugin
var switcherEl = ;
You can also change it in the html
Public methods
Set value
switcherEl;
Set disabled
switcherEl;
Set language
switcherEl;
Get language
switcherEl;
Import language json file
switcherEl;
- the json object need to follow this structure:
en: yes: 'yes' no: 'no' fr: yes: 'oui' no: 'non'