shannon
shannon

Reputation: 8774

Incorrect jQuery UI slider handle, advances from 2 directly to limit

My jQuery UI handle displays the number 14 correctly when loading the page, but if I set it a second time it moves the slider handle all the way to the end. Here's the sample:

http://jsfiddle.net/rRrgV/

Surely I've done something silly, right?

Upvotes: 1

Views: 136

Answers (1)

j08691
j08691

Reputation: 207861

Change:

var v = input.val();

to:

var v = parseInt(input.val(),10);

Your v variable is a string so you need to convert it to an integer.

jsFiddle example.

Upvotes: 1

Related Questions