mirror of
https://github.com/jquery/jquery-ui.git
synced 2024-10-05 01:44:18 +00:00
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)
This commit is contained in:
parent
cacb2acee4
commit
5b00c21719
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user