\r
//Initialize needed constants\r
var o = this.options;\r
- \r
- this.mouseInit();\r
- \r
+\r
//Position the node\r
if(o.helper == 'original' && !(/(relative|absolute|fixed)/).test(this.element.css('position')))\r
this.element.css('position', 'relative');\r
\r
+ this.mouseInit();\r
+ \r
},\r
mouseStart: function(e) {\r
var o = this.options;\r
pos.top // the calculated relative position\r
+ this.offset.relative.top * mod // Only for relative positioned nodes: Relative offset from element to offset parent\r
+ this.offset.parent.top * mod // The offsetParent's offset without borders (offset + border)\r
- - (this.cssPosition == "fixed" ? 0 : this.offsetParent[0].scrollTop) * mod // The offsetParent's scroll position, not if the element is fixed\r
+ - (this.cssPosition == "fixed" || this.offsetParent[0] == document.body ? 0 : this.offsetParent[0].scrollTop) * mod // The offsetParent's scroll position, not if the element is fixed\r
+ + (this.cssPosition == "fixed" ? this.offsetParent[0].scrollTop : 0) * mod\r
+ this.margins.top * mod //Add the margin (you don't want the margin counting in intersection methods)\r
),\r
left: (\r
pos.left // the calculated relative position\r
+ this.offset.relative.left * mod // Only for relative positioned nodes: Relative offset from element to offset parent\r
+ this.offset.parent.left * mod // The offsetParent's offset without borders (offset + border)\r
- - (this.cssPosition == "fixed" ? 0 : this.offsetParent[0].scrollLeft) * mod // The offsetParent's scroll position, not if the element is fixed\r
+ - (this.cssPosition == "fixed" || this.offsetParent[0] == document.body ? 0 : this.offsetParent[0].scrollLeft) * mod // The offsetParent's scroll position, not if the element is fixed\r
+ + (this.cssPosition == "fixed" ? this.offsetParent[0].scrollLeft : 0) * mod\r
+ this.margins.left * mod //Add the margin (you don't want the margin counting in intersection methods)\r
)\r
};\r
- this.offset.click.top // Click offset (relative to the element)\r
- this.offset.relative.top // Only for relative positioned nodes: Relative offset from element to offset parent\r
- this.offset.parent.top // The offsetParent's offset without borders (offset + border)\r
- + (this.cssPosition == "fixed" ? 0 : this.offsetParent[0].scrollTop) // The offsetParent's scroll position, not if the element is fixed\r
+ + (this.cssPosition == "fixed" || this.offsetParent[0] == document.body ? 0 : this.offsetParent[0].scrollTop) // The offsetParent's scroll position, not if the element is fixed\r
+ - (this.cssPosition == "fixed" ? this.offsetParent[0].scrollTop : 0)\r
),\r
left: (\r
e.pageX // The absolute mouse position\r
- this.offset.click.left // Click offset (relative to the element)\r
- this.offset.relative.left // Only for relative positioned nodes: Relative offset from element to offset parent\r
- this.offset.parent.left // The offsetParent's offset without borders (offset + border)\r
- + (this.cssPosition == "fixed" ? 0 : this.offsetParent[0].scrollLeft) // The offsetParent's scroll position, not if the element is fixed\r
+ + (this.cssPosition == "fixed" || this.offsetParent[0] == document.body ? 0 : this.offsetParent[0].scrollLeft) // The offsetParent's scroll position, not if the element is fixed\r
+ - (this.cssPosition == "fixed" ? this.offsetParent[0].scrollLeft : 0)\r
)\r
};\r
\r