Skip to content

Commit

Permalink
draggable: fixed nasty IE related scrolling bug - funny IE includes s…
Browse files Browse the repository at this point in the history
…croll if you call offset() on <html>
  • Loading branch information
Paul Bakaus committed Nov 6, 2008
1 parent 2619fc8 commit bba3d31
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions ui/ui.draggable.js
Expand Up @@ -109,7 +109,8 @@ $.widget("ui.draggable", $.extend({}, $.ui.mouse, {




this.offsetParent = this.helper.offsetParent(); var po = this.offsetParent.offset(); //Get the offsetParent and cache its position this.offsetParent = this.helper.offsetParent(); var po = this.offsetParent.offset(); //Get the offsetParent and cache its position
if(this.offsetParent[0] == document.body && $.browser.mozilla) po = { top: 0, left: 0 }; //Ugly FF3 fix if(this.offsetParent[0] == document.body && $.browser.mozilla) po = { top: 0, left: 0 }; //Ugly FF3 fix
if(this.offsetParent[0].tagName && this.offsetParent[0].tagName.toLowerCase() == 'html' && $.browser.msie) po = { top: 0, left: 0 }; //Ugly IE fix
this.offset.parent = { //Store its position plus border this.offset.parent = { //Store its position plus border
top: po.top + (parseInt(this.offsetParent.css("borderTopWidth"),10) || 0), top: po.top + (parseInt(this.offsetParent.css("borderTopWidth"),10) || 0),
left: po.left + (parseInt(this.offsetParent.css("borderLeftWidth"),10) || 0) left: po.left + (parseInt(this.offsetParent.css("borderLeftWidth"),10) || 0)
Expand Down Expand Up @@ -240,7 +241,7 @@ $.widget("ui.draggable", $.extend({}, $.ui.mouse, {
}; };
}, },
_generatePosition: function(e) { _generatePosition: function(e) {

var o = this.options; var o = this.options;
var position = { var position = {
top: ( top: (
Expand Down

0 comments on commit bba3d31

Please sign in to comment.