while ( offsetParent && (!rroot.test(offsetParent.nodeName) && jQuery.css(offsetParent, "position") === "static") ) {
offsetParent = offsetParent.offsetParent;
}
- return offsetParent;
+ return offsetParent || document.body;
});
}
});
<div id="fx-tests"></div>
</div>
+ <map name="imgmap" id="imgmap">
+ <area shape="rect" coords="0,0,200,50">
+ </map>
</body>
</html>
});
test("offsetParent", function(){
- expect(11);
+ expect(12);
var body = jQuery("body").offsetParent();
equal( body.length, 1, "Only one offsetParent found." );
equal( div.length, 2, "Two offsetParent found." );
equal( div[0], document.body, "The body is the offsetParent." );
equal( div[1], jQuery("#nothiddendiv")[0], "The div is the offsetParent." );
+
+ var area = jQuery("#imgmap area").offsetParent();
+ equal( area[0], document.body, "The body is the offsetParent." );
});
test("fractions (see #7730 and #7885)", function() {