X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=src%2Foffset.js;h=365b35aca8ec5091babf1c15a82351c1a5f81bbe;hb=8effe3a7dee91c833cc1774646da9d743600c64c;hp=fbefd7a27f921d5a9b4585697f5cf9a335edda15;hpb=1d352084c4257217b0778f1ec3bb2e409411a4c3;p=jquery.git diff --git a/src/offset.js b/src/offset.js index fbefd7a..365b35a 100644 --- a/src/offset.js +++ b/src/offset.js @@ -75,7 +75,8 @@ if ( "getBoundingClientRect" in document.documentElement ) { left += parseFloat( computedStyle.borderLeftWidth ) || 0; } - prevOffsetParent = offsetParent, offsetParent = elem.offsetParent; + prevOffsetParent = offsetParent; + offsetParent = elem.offsetParent; } if ( jQuery.offset.subtractsBorderForOverflowNotVisible && computedStyle.overflow !== "visible" ) { @@ -116,12 +117,16 @@ jQuery.offset = { this.doesNotAddBorder = (checkDiv.offsetTop !== 5); this.doesAddBorderForTableAndCells = (td.offsetTop === 5); - checkDiv.style.position = "fixed", checkDiv.style.top = "20px"; + checkDiv.style.position = "fixed"; + checkDiv.style.top = "20px"; + // safari subtracts parent border width here which is 5px this.supportsFixedPosition = (checkDiv.offsetTop === 20 || checkDiv.offsetTop === 15); checkDiv.style.position = checkDiv.style.top = ""; - innerDiv.style.overflow = "hidden", innerDiv.style.position = "relative"; + innerDiv.style.overflow = "hidden"; + innerDiv.style.position = "relative"; + this.subtractsBorderForOverflowNotVisible = (checkDiv.offsetTop === -5); this.doesNotIncludeMarginInBodyOffset = (body.offsetTop !== bodyMarginTop);