X-Git-Url: http://git.asbjorn.it/?a=blobdiff_plain;f=src%2Foffset.js;h=18261bb570c70bbc43c584dac7c7926ca799d2cf;hb=735a949a0649f0299e8e4d87b259290970a68ddf;hp=1003c400c9223139257c10e511d3828034b47225;hpb=6b08d88d04f4a41849753999e6e18126895086d0;p=jquery.git diff --git a/src/offset.js b/src/offset.js index 1003c40..18261bb 100644 --- a/src/offset.js +++ b/src/offset.js @@ -181,10 +181,10 @@ jQuery.offset = { curOffset = curElem.offset(), curCSSTop = jQuery.css( elem, "top" ), curCSSLeft = jQuery.css( elem, "left" ), - calculatePosition = (position === "absolute" && jQuery.inArray('auto', [curCSSTop, curCSSLeft]) > -1), + calculatePosition = ((position === "absolute" || position === "fixed") && jQuery.inArray('auto', [curCSSTop, curCSSLeft]) > -1), props = {}, curPosition = {}, curTop, curLeft; - // need to be able to calculate position if either top or left is auto and position is absolute + // 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(); }