Skip to content
Permalink
Browse files

slider: use handle width / 2 instead of marginLeft to find offset of …

…mousedown relative to center of handle (fixes #4063 - slider: horizontal slider handle jumps up when you click on it IE6)
  • Loading branch information...
rdworth committed Feb 28, 2009
1 parent cacb2ac commit 5b00c217190538fc1e03dcd69b1cadd3e66d5dc9
Showing with 1 addition and 1 deletion.
  1. +1 −1 ui/ui.slider.js
@@ -222,7 +222,7 @@ $.widget("ui.slider", $.extend({}, $.ui.mouse, {
var offset = closestHandle.offset();
var mouseOverHandle = !$(event.target).parents().andSelf().is('.ui-slider-handle');
this._clickOffset = mouseOverHandle ? { left: 0, top: 0 } : {
left: event.pageX - offset.left + (parseInt(closestHandle.css('marginLeft'),10) || 0),
left: event.pageX - offset.left - (closestHandle.width() / 2),
top: event.pageY - offset.top
- (closestHandle.height() / 2)
- (parseInt(closestHandle.css('borderTopWidth'),10) || 0)

0 comments on commit 5b00c21

Please sign in to comment.
You can’t perform that action at this time.