I found a ToggleSwitch plugin that uses Jquery UI library but I can’t seem to find a way to toggle the switch after init at runtime.
The plugin can be found here
With Jquery slider, one can simply force slider change through values option, ie:
$("#slider").slider('values', 0,100);
The configuration options include:
$(".selector").toggleSwitch({
highlight: true, // default
width: 25, // default
change: function(e) {
console.log("i changed my value")
} // default: null
});
Any help is appreciated!
Create toggle switch on it:
To toggle – call “click” on label for option “off” (index = 1):
eq(1) here is index of option value (OFF). For ON it would be eq(0).
Here’s fiddle with timeout to force “OFF” from code: http://jsfiddle.net/5ZSuw/