X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=src%2Foffset.js;h=8ee5680deb287c35bf8669c2a903fdb441381454;hb=6c81082a6b20880cbd5d35ec5c50d4270f3af2ce;hp=46b971bc9614dc3b16e64d35f3e0992b96e971be;hpb=feb9051c0e29937c2494c3db0862a671efc21747;p=jquery.git diff --git a/src/offset.js b/src/offset.js index 46b971b..8ee5680 100644 --- a/src/offset.js +++ b/src/offset.js @@ -55,7 +55,7 @@ jQuery.fn.offset = function() { } // Get parent scroll offsets - while ( parent.tagName && !/^body|html$/i.test(parent.tagName) ) { + while ( parent && parent.tagName && !/^body|html$/i.test(parent.tagName) ) { // Remove parent scroll UNLESS that parent is inline or a table to work around Opera inline/table scrollLeft/Top bug if ( !/^inline|table.*$/i.test(jQuery.css(parent, "display")) ) // Subtract parent scroll offsets @@ -72,7 +72,7 @@ jQuery.fn.offset = function() { // Safari <= 2 doubles body offsets with a fixed position element/offsetParent or absolutely positioned offsetChild // Mozilla doubles body offsets with a non-absolutely positioned offsetChild if ( (safari2 && (fixed || jQuery.css(offsetChild, "position") == "absolute")) || - (mozilla && jQuery.css(offsetChild, "position") != "absoltue") ) + (mozilla && jQuery.css(offsetChild, "position") != "absolute") ) add( -doc.body.offsetLeft, -doc.body.offsetTop ); // Add the document scroll offsets if position is fixed @@ -86,7 +86,7 @@ jQuery.fn.offset = function() { } function border(elem) { - add( jQuery.css(elem, "borderLeftWidth"), jQuery.css(elem, "borderTopWidth") ); + add( jQuery.curCSS(elem, "borderLeftWidth", true), jQuery.curCSS(elem, "borderTopWidth", true) ); } function add(l, t) {