aboutsummaryrefslogtreecommitdiffstats
path: root/src/offset.js
diff options
context:
space:
mode:
authorjeresig <jeresig@gmail.com>2011-04-12 00:25:36 -0400
committerjeresig <jeresig@gmail.com>2011-04-12 00:25:36 -0400
commit0d755dff13ae36a9b2f79ecbb0db05dd2c322e42 (patch)
tree019580c604c385266bafb31a6d5fedcd9650b308 /src/offset.js
parentea6987e078cedb1a4a8012b8e98b5f245417407b (diff)
parent75655e5758bc786989f26a98b09aabbfb88f66fd (diff)
downloadjquery-0d755dff13ae36a9b2f79ecbb0db05dd2c322e42.tar.gz
jquery-0d755dff13ae36a9b2f79ecbb0db05dd2c322e42.zip
Merge branch 'master' of https://github.com/inukshuk/jquery into inukshuk-master
Conflicts: test/unit/offset.js
Diffstat (limited to 'src/offset.js')
-rw-r--r--src/offset.js8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/offset.js b/src/offset.js
index a0cd7a156..7abd6af17 100644
--- a/src/offset.js
+++ b/src/offset.js
@@ -186,11 +186,13 @@ jQuery.offset = {
// 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;
+ curLeft = curPosition.left;
+ } else {
+ curTop = parseFloat( curCSSTop ) || 0;
+ curLeft = parseFloat( curCSSLeft ) || 0;
}
- curTop = calculatePosition ? curPosition.top : parseInt( curCSSTop, 10 ) || 0;
- curLeft = calculatePosition ? curPosition.left : parseInt( curCSSLeft, 10 ) || 0;
-
if ( jQuery.isFunction( options ) ) {
options = options.call( elem, i, curOffset );
}