Skip to main content

beforeChange

fires before changing of the slider value

beforeChange: (value: number, oldValue: number, isRange: boolean) => boolean | void;

Parameters:

  • value: number - the new value set for the slider
  • oldValue: number - the previous value of the slider
  • isRange: boolean - defines, whether the range mode is activated for the slider

Returns:

Return false to prevent changing the slider value; otherwise, true.

Example

slider.events.on("beforeChange", function(value, oldValue, isRange){
console.log("The value of a slider will be changed to "+slider.getValue());
return true;
});

Related sample: Slider. Events

Change log:

added in v8.0