ion.rangeSlider icon indicating copy to clipboard operation
ion.rangeSlider copied to clipboard

disable the dragging of the slider. Only want to use for display

Open sant527 opened this issue 3 years ago • 3 comments

I am using ionrangeslider to display some temperature value. I like the way it displays.

I dont want the user to slide it. How can i disable the slider

I didnt find any option to diable dragging

this is the html and the js i am using

					    <input type="text" class="js-range-slider" name="my_range" value=""
					        data-min="40"
					        data-max="210"
					        data-from="115"
					        data-grid="true",
					        data-hide-min-max="true",
					        data-postfix="'F"
					    />

					    $('.js-range-slider').ionRangeSlider()

It shows as enter image description here

sant527 avatar Feb 04 '21 19:02 sant527

Hi, you can't disable it through API. But you could do it via CSS. Like this:

.irs-from,
.irs-to,
.irs-single {
  pointer-events: none;
}

IonDen avatar Feb 05 '21 13:02 IonDen

If you want to block movement completely, you could use allowed range attributes, like this:

        from_min: 115,
        from_max: 115,

Check 2-nd demo here: http://ionden.com/a/plugins/ion.rangeSlider/demo_advanced.html#a_handles

IonDen avatar Feb 05 '21 13:02 IonDen

thank you, this is what i was looking for

If you want to block movement completely, you could use allowed range attributes, like this:

        from_min: 115,
        from_max: 115,

Check 2-nd demo here: http://ionden.com/a/plugins/ion.rangeSlider/demo_advanced.html#a_handles

sant527 avatar Feb 08 '21 17:02 sant527