Toggle
Embellishes a standard checkbox input element to appear as a toggle switch.
<input id="customCheckbox" type="checkbox" />
var toggleWidget = $("#customCheckbox").toggle();
Options
Name |
Type |
Default |
Description |
affirmativeText |
string |
yes |
text to display in the toggle when checked |
checked |
boolean |
false |
whether or not the toggle should be checked |
disabled |
boolean |
false |
whether or not the toggle should be disabled |
negativeText |
string |
no |
text to display in the toggle when not checked |
onChange |
function(event, data) |
none |
Called every time the checked state changes, use data.checked to access the checked state |
Methods
Name |
Description |
checked({boolean}) |
reads or sets the current checked state |
disabled({boolean}) |
reads or sets whether or not the control is disabled |
destory() |
remove the toggle widget |