// Remove the body element we added
testElement.innerHTML = "";
- testElementParent.removeChild( testElement );
// Technique from Juriy Zaytsev
// http://thinkweb2.com/projects/prototype/detecting-event-support-without-browser-sniffing/
}
// Determine fixed-position support early
+ testElement.style.position = "static";
+ testElement.style.top = "0px";
+ testElement.style.marginTop = "1px";
offsetSupport = (function( body, container ) {
var outer, inner, table, td, supports,
bodyMarginTop = parseFloat( body.style.marginTop ) || 0,
- ptlm = "position:absolute;top:0;left:0;width:1px;height:1px;",
- style = "style='" + ptlm + "margin:0;border:5px solid #000;padding:0;'",
+ ptlm = "position:absolute;top:0;left:0;width:1px;height:1px;margin:0;",
+ style = "style='" + ptlm + "border:5px solid #000;padding:0;'",
html = "<div " + style + "><div></div></div>" +
"<table " + style + " cellpadding='0' cellspacing='0'>" +
"<tr><td></td></tr></table>";
})( testElement, div );
jQuery.extend( support, offsetSupport );
+ testElementParent.removeChild( testElement );
// Null connected elements to avoid leaks in IE
testElement = fragment = select = opt = body = marginDiv = div = input = null;
testoffset("body", function( jQuery ) {
expect(2);
- equals( jQuery("body").offset().top, 0, "jQuery('#body').offset().top" );
- equals( jQuery("body").offset().left, 0, "jQuery('#body').offset().left" );
+ equals( jQuery("body").offset().top, 1, "jQuery('#body').offset().top" );
+ equals( jQuery("body").offset().left, 1, "jQuery('#body').offset().left" );
});
test("Chaining offset(coords) returns jQuery object", function() {