]> source.dussan.org Git - jquery.git/commitdiff
Couple of fixes to the offset method
authorBrandon Aaron <brandon.aaron@gmail.com>
Tue, 11 Sep 2007 00:43:12 +0000 (00:43 +0000)
committerBrandon Aaron <brandon.aaron@gmail.com>
Tue, 11 Sep 2007 00:43:12 +0000 (00:43 +0000)
src/offset.js

index 674338ecbf0397a75ccc44c56f4990bc33387055..19090ac091a61f8c8c25ce7ccc0a9898238874d7 100644 (file)
@@ -55,7 +55,7 @@ jQuery.fn.offset = function() {
                        }
                
                        // Get parent scroll offsets
-                       while ( parent.tagName && /^body|html$/i.test(parent.tagName) ) {
+                       while ( parent.tagName && !/^body|html$/i.test(parent.tagName) ) {
                                // Work around opera inline/table scrollLeft/Top bug
                                if ( /^inline|table-row.*$/i.test(jQuery.css(parent, "display")) )
                                        // Subtract parent scroll offsets
@@ -70,7 +70,7 @@ jQuery.fn.offset = function() {
                        }
                
                        // Safari doubles body offsets with an absolutely positioned element or parent
-                       if ( safari && absolute )
+                       if ( safari2 && absolute )
                                add( -doc.body.offsetLeft, -doc.body.offsetTop );
                }