Methods
In Bootstrap Switch, every option is also a method.
If the second parameter is omitted, the method returns the current value.
You can invoke methods as follows:
$('input[name="my-checkbox"]').bootstrapSwitch('state', true, true);Additional Methods
| Name | Description |
|---|---|
| toggleState | Toggle the switch state |
| toggleAnimate | Toggle the animate option |
| toggleDisabled | Toggle the disabled state |
| toggleReadonly | Toggle the readonly state |
| toggleIndeterminate | Toggle the indeterminate state |
| toggleInverse | Toggle the inverse option |
| destroy | Destroy the instance of Bootstrap Switch |
Special Behaviours
- The method
statecan receive an optional third parameterskip. if true,switchChangeevent is not executed. The default is false. - The method
toggleStatecan receive an optional second parameterskip. if true,switchChangeevent is not executed. The default is false. - The method
wrapperClasscan accept a falsy value as second parameter. If so, it resets the class to its default.
