Fixed boxModel support - is now computed with feature detection, rather than sniffing.
This commit is contained in:
parent
0066ba3f82
commit
7346a476cc
3 changed files with 14 additions and 5 deletions
|
@ -53,7 +53,8 @@
|
|||
|
||||
// Will be defined later
|
||||
scriptEval: false,
|
||||
noCloneEvent: true
|
||||
noCloneEvent: true,
|
||||
boxModel: null
|
||||
};
|
||||
|
||||
script.type = "text/javascript";
|
||||
|
@ -83,6 +84,17 @@
|
|||
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";
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue