You can attach event listeners with the slider.events.on() method:
slider.events.on("Change", function(newValue, oldValue, isRange){
console.log("The value of a slider has changed to "+slider.getValue());
});
The names of events are case-insensitive.
Related sample: Slider. Slider Events
To detach events, use slider.events.detach():
slider.events.on("Change", function(newValue, oldValue, isRange) {
console.log("The value of a slider has changed to "+slider.getValue());
});
slider.events.detach("Change");
To call events, use slider.events.fire():
slider.events.fire("name",args);
// where args is an array of arguments
The full list of events is available in the related API section.
Back to top