IonDen / ion.rangeSlider

jQuery only range slider
http://ionden.com/a/plugins/ion.rangeSlider/en.html
MIT License
2.55k stars 505 forks source link

Clicking after initialization doesn't call onChange #81

Closed titpetric closed 10 years ago

titpetric commented 10 years ago

When the slider is activated, the onChange callback doesn't get called if the slider is moved by clicking on the range.

Fix: Add the following code to the beginning of the moveByClick function:

firstStart = false;

Best, Tit

robhuska commented 10 years ago

So I have found the exact same thing, except that if you drag first, and the click it works, but a click before dragging will not work...

Could you please elaborate on this "Fix" maybe a code snippet or example? Here is my code, what would i put to make an initial click work?

$("#range_slider").ionRangeSlider({ min: 0, max: 100000, type: 'double', maxPostfix: "+", prettify: true, onChange: function (obj) { // callback is called on slider action is finished rangeResults = obj; obj.from = obj.fromNumber; obj.to = obj.toNumber; $('input#square_feet_max').attr('value', obj.toNumber); $('input#square_feet_min').attr('value', obj.fromNumber); } });

Thanks!

titpetric commented 10 years ago

Take ion.rangeSlider.js, and add "firstStart = false;" on line 815 (empty line).

Best, Tit

IonDen commented 10 years ago

Tnx, will be fixed soon.

IonDen commented 10 years ago

Fixed in 1.9.1