This one does not trigger an error on IE: margin: 10px;
This one does trigger an error on IE: margin: 5px 10px;
This code triggers errors any more (ligne 825 and follow):
// From the awesome hack by Dean Edwards
// http://erik.eae.net/archives/2007/07/27/18.54.15/#comment-102291
// If we're not dealing with a regular pixel number
// but a number that has a weird ending, we need to convert it to pixels
if ( !/^\d+(px)?$/i.test( ret ) && /^\d/.test( ret ) ) {
// Remember the original values
var left = style.left, rsLeft = elem.runtimeStyle.left;
// Put in the new values to get a computed value out
elem.runtimeStyle.left = elem.currentStyle.left;
style.left = ret || 0;
ret = style.pixelLeft + "px";
// Revert the changed values
style.left = left;
elem.runtimeStyle.left = rsLeft;
}
This code does not trigger errors any more:
// From the awesome hack by Dean Edwards
// http://erik.eae.net/archives/2007/07/27/18.54.15/#comment-102291
// If we're not dealing with a regular pixel number
// but a number that has a weird ending, we need to convert it to pixels
if ( !/^\d+(px)?$/i.test( ret ) && /^\d/.test( ret ) ) {
// Remember the original values
var left = style.left[name], rsLeft = elem.runtimeStyle.left[name];
// Put in the new values to get a computed value out
elem.runtimeStyle.left[name] = elem.currentStyle.left[name];
style.left[name] = ret || 0;
ret = style.pixelLeft + "px";
// Revert the changed values
style.left[name] = left || 0;
elem.runtimeStyle.left[name] = rsLeft;
}
Not formated version:
// From the awesome hack by Dean Edwards
// http://erik.eae.net/archives/2007/07/27/18.54.15/#comment-102291
// If we're not dealing with a regular pixel number
// but a number that has a weird ending, we need to convert it to pixels
if ( !/^\d+(px)?$/i.test( ret ) && /^\d/.test( ret ) ) {
// Remember the original values
var left = style[name], rsLeft = elem.runtimeStyle[name];
// Put in the new values to get a computed value out
elem.runtimeStyle[name] = elem.currentStyle[name];
style[name] = ret || 0;
ret = style.pixelLeft + "px";
// Revert the changed values
style[name] = left || 0;
elem.runtimeStyle[name] = rsLeft;
}