I used a slider on a customers website and found following strange behaviour:
If you have a slider-element and let's say 1/3 of the slider is filled with
the knob, 2 strange things happen:
1. if you click somewhere into the empty slider (not onto the knob), then
the middle of the knob jumps to the mouse-position. but the knob is NOT
draggable.
2. if you click near to the end of the knob, then the middle of the knob
jumps to the mouse position. if you move the mouse now, then for a short
time, the knob jumps back to the position it had, before you clicked on it.
i already found the fix for that behaviour in the Slider class:
this.drag.start(event);
is missing at the end of the clickedElement()-method.
the whole method:
clickedElement: function(event){
var dir = this.range < 0 ? -1 : 1;
var position = event.page[this.axis] -
this.element.getPosition()[this.axis] - this.half;
position = position.limit(-this.options.offset, this.full
-this.options.offset);
this.step = Math.round(this.min + dir * this.toStep(position));
this.checkStep();
this.end();
this.fireEvent('tick', position);
this.drag.start(event);
}
hope this was helpful,
Stefan Jelner
-----
@todo: Everything!
--
View this message in context:
http://n2.nabble.com/Bug-in-Slider-%28jumping-knob%29-tp1359254p1359254.html
Sent from the MooTools Users mailing list archive at Nabble.com.