Skip to main content

Event Handling

Attaching event listeners#

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());});
note

The names of events are case-insensitive.

Related sample: Slider. Slider Events

Detaching event listeners#

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");

Calling events#

To call events, use slider.events.fire():

slider.events.fire("name",args);// where args is an array of arguments

The list of events#

The full list of events is available in the related API section.