this.containment = [
co.left + (parseInt($(ce).css(“borderLeftWidth”),10) || 0) + (parseInt($(ce).css(“paddingLeft”),10) || 0) – this.margins.left,
co.top + (parseInt($(ce).css(“borderTopWidth”),10) || 0) + (parseInt($(ce).css(“paddingTop”),10) || 0) – this.margins.top,
co.left+(over ? Math.max(ce.scrollWidth,ce.offsetWidth) : ce.offsetWidth) – (parseInt($(ce).css(“borderLeftWidth”),10) || 0) – (parseInt($(ce).css(“paddingRight”),10) || 0) – this.helperProportions.width – this.margins.left,
co.top+(over ? Math.max(ce.scrollHeight,ce.offsetHeight) : ce.offsetHeight) – (parseInt($(ce).css(“borderTopWidth”),10) || 0) – (parseInt($(ce).css(“paddingBottom”),10) || 0) – this.helperProportions.height – this.margins.top
];
}
},
_convertPositionTo: function(d, pos) {
if(!pos) pos = this.position;
var mod = d == “absolute” ? 1 : -1;
var o = this.options, scroll = this.cssPosition == ‘absolute’ && !(this.scrollParent[0] != document && $.ui.contains(this.scrollParent[0], this.offsetParent[0])) ? this.offsetParent : this.scrollParent, scrollIsRootNode = (/(html|body)/i).test(scroll[0].tagName);
return {
top: (
pos.top // The absolute mouse position
+ this.offset.relative.top * mod // Only for relative positioned nodes: Relative offset from element to offset parent
+ this.offset.parent.top * mod // The offsetParent’s offset without borders (offset + border)
– ($.browser.safari && this.cssPosition == ‘fixed’ ? 0 : ( this.cssPosition == ‘fixed’ ? -this.scrollParent.scrollTop() : ( scrollIsRootNode ? 0 : scroll.scrollTop() ) ) * mod)
),
left: (
pos.left // The absolute mouse position
+ this.offset.relative.left * mod // Only for relative positioned nodes: Relative offset from element to offset parent
+ this.offset.parent.left * mod // The offsetParent’s offset without borders (offset + border)
– ($.browser.safari && this.cssPosition == ‘fixed’ ? 0 : ( this.cssPosition == ‘fixed’ ? -this.scrollParent.scrollLeft() : scrollIsRootNode ? 0 : scroll.scrollLeft() ) * mod)
)
};
},
_generatePosition: function(event) {
var o = this.options, scroll = this.cssPosition == ‘absolute’ && !(this.scrollParent[0] != document && $.ui.contains(this.scrollParent[0], this.offsetParent[0])) ? this.offsetParent : this.scrollParent, scrollIsRootNode = (/(html|body)/i).test(scroll[0].tagName);
// This is another very weird special case that only happens for relative elements:
// 1. If the css position is relative
// 2. and the scroll parent is the document or similar to the offset parent
// we have to refresh the relative offset during the scroll so there are no jumps
if(this.cssPosition == ‘relative’ && !(this.scrollParent[0] != document && this.scrollParent[0] != this.offsetParent[0])) {










