diff options
Diffstat (limited to 'src/offset.js')
-rw-r--r-- | src/offset.js | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/offset.js b/src/offset.js index 42d07eb4f..954ab8add 100644 --- a/src/offset.js +++ b/src/offset.js @@ -46,7 +46,8 @@ jQuery.offset = { calculatePosition = ( position === "absolute" || position === "fixed" ) && jQuery.inArray("auto", [ curCSSTop, curCSSLeft ] ) > -1; - // need to be able to calculate position if either top or left is auto and position is either absolute or fixed + // need to be able to calculate position if either top or left + // is auto and position is either absolute or fixed if ( calculatePosition ) { curPosition = curElem.position(); curTop = curPosition.top; @@ -122,7 +123,8 @@ jQuery.fn.extend({ parentOffset = { top: 0, left: 0 }, elem = this[ 0 ]; - // fixed elements are offset from window (parentOffset = {top:0, left: 0}, because it is its only offset parent + // Fixed elements are offset from window (parentOffset = {top:0, left: 0}, + // because it is its only offset parent if ( jQuery.css( elem, "position" ) === "fixed" ) { // we assume that getBoundingClientRect is available when computed position is fixed offset = elem.getBoundingClientRect(); @@ -154,7 +156,8 @@ jQuery.fn.extend({ return this.map(function() { var offsetParent = this.offsetParent || docElem; - while ( offsetParent && ( !jQuery.nodeName( offsetParent, "html" ) && jQuery.css( offsetParent, "position" ) === "static" ) ) { + while ( offsetParent && ( !jQuery.nodeName( offsetParent, "html" ) && + jQuery.css( offsetParent, "position" ) === "static" ) ) { offsetParent = offsetParent.offsetParent; } return offsetParent || docElem; |