mozilla: /mozilla/.test( userAgent ) && !/(compatible|webkit)/.test( userAgent )
};
-// Check to see if the W3C box model is being used
-jQuery.boxModel = !jQuery.browser.msie || document.compatMode == "CSS1Compat";
-
jQuery.each({
parent: function(elem){return elem.parentNode;},
parents: function(elem){return jQuery.dir(elem,"parentNode");},
// Will be defined later
scriptEval: false,
- noCloneEvent: true
+ noCloneEvent: true,
+ boxModel: null
};
script.type = "text/javascript";
div.cloneNode(true).fireEvent("onclick");
}
+ // Figure out if the W3C box model works as expected
+ // document.body must exist before we can do this
+ jQuery(function(){
+ var div = document.createElement("div");
+ div.style.width = "1px";
+ div.style.paddingLeft = "1px";
+
+ document.body.appendChild( div );
+ jQuery.boxModel = jQuery.support.boxModel = div.offsetWidth === 2;
+ document.body.removeChild( div );
+ });
})();
var styleFloat = jQuery.support.cssFloat ? "cssFloat" : "styleFloat";