diff options
author | jeresig <jeresig@gmail.com> | 2010-03-01 16:26:57 -0500 |
---|---|---|
committer | jeresig <jeresig@gmail.com> | 2010-03-01 16:26:57 -0500 |
commit | fc08d0ea8dc881ed56102eb14e3ad9c54cccc34e (patch) | |
tree | c71c23111baea10ae0870341dc03af3997be0344 /src/offset.js | |
parent | a18f682012ae8e63f3b43b39375b3c5ce0a561e3 (diff) | |
download | jquery-fc08d0ea8dc881ed56102eb14e3ad9c54cccc34e.tar.gz jquery-fc08d0ea8dc881ed56102eb14e3ad9c54cccc34e.zip |
Fixed some cases where expression, expression was used and shouldn't be.
Diffstat (limited to 'src/offset.js')
-rw-r--r-- | src/offset.js | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/offset.js b/src/offset.js index fbefd7a27..365b35aca 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); |