Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Basic Jquery Slider interval issue

Tags:

jquery

In this simple code, the slider does not slide to the correct point (which should be 14 + 12 or 26). Instead it slides to 24.

$("#slider").slider({
range: "min",
min: 0,
max: 100,
step: 12,
value: 14,
slide: function( event, ui ) {
    $("#slider-value").text( ui.value );
};

});

Fiddle me : http://jsfiddle.net/slandmann/conyyam1/12/

like image 715
slandmann Avatar asked Mar 18 '26 20:03

slandmann


1 Answers

The "error" is in the min value. Basically, you can't get your value (14) with a step of 12 from your min (0), it' just simple math. To fix this, you need to set a different step (2, 7 or 14) or set the min to 2.

like image 55
herkil Avatar answered Mar 20 '26 10:03

herkil



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!