Search.../

sliderType

Sets or gets a range slider's type.

Description

The sliderType can be set to one of the following:

  • 'Continuous': A continuous range slider allows site visitors to select any value within the range you set. The handles move smoothly at a step value of 0.1, along the slider's track.
  • 'Stepped': A stepped range slider only allows site visitors to select specific values within the set range. The handles move along tick marks displayed underneath the stepped slider's track. The tick marks are based on a step value that can be adjusted by setting the step property.

Type:

stringRead & Write, default value is 'Continuous'

Was this helpful?

Get a range slider's type

Copy Code
1let rangeSliderType = $w('#myRangeSlider').sliderType; // 'Stepped'
Set a range slider's type

Copy Code
1$w('#myRangeSlider').sliderType = 'Stepped';
Toggle a range slider's type

Copy Code
1$w('#sliderTypeToggleButton').onClick(() => {
2 if($w('#myRangeSlider').sliderType === 'Continuous') {
3 $w('#myRangeSlider').sliderType = 'Stepped';
4 }
5 else{
6 $w('#myRangeSlider').sliderType = 'Continuous';
7 }
8})