EasyUI Forum

General Category => EasyUI for jQuery => Topic started by: rezzonico on January 24, 2022, 01:33:32 AM



Title: slider + exclude value
Post by: rezzonico on January 24, 2022, 01:33:32 AM
Hi all,

my slider is defined as follow:
min: 1,
max: 4,
step: 1

The values displayed are: 1,2,3,4

I need to exclude "3" and display:
1,2,4

Is it possible ?

Thanks
Miche


Title: Re: slider + exclude value
Post by: jarry on January 24, 2022, 07:24:26 PM
Listen to the 'onChange' event, if the value equals to 3 then set it to another value. Please try this code.
Code:
$('#s1').slider({
onChange: function(value){
if (value==3){
$(this).slider('setValue', 4);
}
}
})


Title: Re: slider + exclude value
Post by: rezzonico on January 28, 2022, 04:33:41 AM
Thanks !

Regards
Miche