Closed sander76 closed 10 years ago
Seconded. Any ideas what's causing this or how to fix?
I agree a solution would be nice. I haven't tinkered enough with the slider but I think the issue stems from the calculation in finding the mouse when clicking on the knob. The below hack makes it a bit better in that if you click the center of the knob it doesn't jump. It still jumps slightly when you click the left or right side of the knob.
// get the raw value where the mouse/finger/etc is starting
var newValue = minValueDecoded +
(valueRangeDecoded * percentFromOffset(bringOffsetInRange(currentX + minOffset - offsetLeft(element))) /
100.0) - 2; // <-- Just subtracted the value by 2
@rjoo That calculation isn't the root of the problem. It's just not setting the knob position to stay under the mouse on mousedown like it does on mousemove.
I know what needs to be done to fix it, I just haven't had the time to work on it yet. I'll be able to get to it this weekend.
Great ! thanks in advance !
The fix for this is up. If it still feels jumpy, set the stickiness to 1.
Thanks for this slider !
One thing I am experiencing though is what I would call the "jumpiness" of the slider knob: If I use your example.html and click on a knob it "jumps" to the value I have clicked (mostly one value next to the current value). But I am not clicking to go to a value. I am clicking on the knob to grab it.
I know it is a minor detail, but I think solving this makes this control look and work even better.
Sander.