Commit e2fc9933 authored by Brandon Aaron's avatar Brandon Aaron

offset: make sure there is a parent node to work on while calculating scroll offsets (#2073)

parent add0681f
...@@ -55,7 +55,7 @@ jQuery.fn.offset = function() { ...@@ -55,7 +55,7 @@ jQuery.fn.offset = function() {
} }
// Get parent scroll offsets // 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 // 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")) ) if ( !/^inline|table.*$/i.test(jQuery.css(parent, "display")) )
// Subtract parent scroll offsets // Subtract parent scroll offsets
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment