Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to fix Jquery UI slider, Showing Negative value

enter image description here The Jquery UI Slider Sometimes showing -1 value in firefox 10.0.2 How to fix this ?

The problem is in the demo of the orginal plugin site jqueryui.com/demos/slider/range.html

like image 885
Sanooj Avatar asked Nov 04 '22 04:11

Sanooj


2 Answers

Its a bug with jQuery UI library.. others also reported it with version 1.8.16.. You can see it here http://bugs.jqueryui.com/ticket/8108

As per the comments in the thread I have checked it with 1.8.17 and its working great.. so seems like the bug got re introduced in 1.8.18..

Try changing the files to version 1.8.17.. it should work!

like image 79
Ansar Muhammad Avatar answered Nov 07 '22 22:11

Ansar Muhammad


I noticed this when working with Firefox 10.0.2 for OS X, and found that it existed for jQuery UI 1.8.16, 1.8.17 and 1.8.18, so unfortunately Anz's solution didn't work for me.

I made a really simply patch-job of it in the meantime, by simply going to function I use to update the sliders' labels' and rewriting it:

function SlideFunction(sSlider, ui) {
    if (ui.value == -1) {
        ui.value = 0;
    };
    $(sSlider).val(ui.value);
};

Where sSlider is a local string variable that contains the ID of the slider being moved.

like image 35
Brideau Avatar answered Nov 07 '22 21:11

Brideau