Skip to content

Commit

Permalink
slider: use handle width / 2 instead of marginLeft to find offset of …
Browse files Browse the repository at this point in the history
…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 5b00c21
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ui/ui.slider.js
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ $.widget("ui.slider", $.extend({}, $.ui.mouse, {
var offset = closestHandle.offset(); var offset = closestHandle.offset();
var mouseOverHandle = !$(event.target).parents().andSelf().is('.ui-slider-handle'); var mouseOverHandle = !$(event.target).parents().andSelf().is('.ui-slider-handle');
this._clickOffset = mouseOverHandle ? { left: 0, top: 0 } : { 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 top: event.pageY - offset.top
- (closestHandle.height() / 2) - (closestHandle.height() / 2)
- (parseInt(closestHandle.css('borderTopWidth'),10) || 0) - (parseInt(closestHandle.css('borderTopWidth'),10) || 0)
Expand Down

0 comments on commit 5b00c21

Please sign in to comment.