mirror of
https://github.com/jquery/jquery.git
synced 2026-04-20 03:01:22 -04:00
Fix for bug #760 (fontSize returns different values in IE). This was part of a larger issue where IE returned non-pixel values from it's computed style - this normalizes it (thanks to a fix by Dean Edwards).
This commit is contained in:
15
src/jquery/jquery.js
vendored
15
src/jquery/jquery.js
vendored
@@ -643,6 +643,21 @@ jQuery.extend({
|
||||
ret = prop == "display" && swap[stack.length-1] != null ?
|
||||
"none" :
|
||||
document.defaultView.getComputedStyle(elem,null).getPropertyValue(prop) || "";
|
||||
|
||||
// Finally, revert the display styles back
|
||||
for ( a = 0; a < swap.length; a++ )
|
||||
if ( swap[a] != null )
|
||||
stack[a].style.display = swap[a];
|
||||
}
|
||||
|
||||
if ( prop == "opacity" && ret == "" )
|
||||
ret = "1";
|
||||
|
||||
} else if (elem.currentStyle) {
|
||||
var newProp = prop.replace(/\-(\w)/g,function(m,c){return c.toUpperCase();});
|
||||
ret = elem.currentStyle[prop] || elem.currentStyle[newProp];
|
||||
|
||||
// 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
|
||||
|
||||
Reference in New Issue
Block a user