Skip to content
Permalink
Browse files

offset: make sure there is a parent node to work on while calculating…

… scroll offsets (#2073)
  • Loading branch information
brandonaaron committed Dec 19, 2007
1 parent add0681 commit e2fc993334698b2a66dd24a671a9c23705df0fc3
Showing with 1 addition and 1 deletion.
  1. +1 −1 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

0 comments on commit e2fc993

Please sign in to comment.
You can’t perform that action at this time.