diff options
author | jeresig <jeresig@gmail.com> | 2010-09-27 10:38:13 -0400 |
---|---|---|
committer | jeresig <jeresig@gmail.com> | 2010-09-27 10:38:13 -0400 |
commit | 6dd2dc42700fff681513aa5a3bdc438bd48f4ba0 (patch) | |
tree | a2d7576572a78a078e000f1e096199e1b9e23215 /src/css.js | |
parent | 88fc523c59465b28633de91f4c9e87b8364064b7 (diff) | |
download | jquery-6dd2dc42700fff681513aa5a3bdc438bd48f4ba0.tar.gz jquery-6dd2dc42700fff681513aa5a3bdc438bd48f4ba0.zip |
Make sure the currentStyle property exists before attempting to access it.
Diffstat (limited to 'src/css.js')
-rw-r--r-- | src/css.js | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/css.js b/src/css.js index 69c4452b2..b9a1c52be 100644 --- a/src/css.js +++ b/src/css.js @@ -174,7 +174,7 @@ if ( !jQuery.support.opacity ) { jQuery.cssHooks.opacity = { get: function( elem, computed ) { // IE uses filters for opacity - return ropacity.test((computed ? elem.currentStyle.filter : elem.style.filter) || "") ? + return ropacity.test((computed && elem.currentStyle ? elem.currentStyle.filter : elem.style.filter) || "") ? (parseFloat(RegExp.$1) / 100) + "" : "1"; }, @@ -191,7 +191,7 @@ if ( !jQuery.support.opacity ) { "" : "alpha(opacity=" + value * 100 + ")"; - var filter = style.filter || elem.currentStyle.filter || ""; + var filter = style.filter || elem.currentStyle && elem.currentStyle.filter || ""; style.filter = ralpha.test(filter) ? filter.replace(ralpha, opacity) : @@ -219,7 +219,7 @@ if ( getComputedStyle ) { } else if ( document.documentElement.currentStyle ) { curCSS = function( elem, name ) { - var left, rsLeft, ret = elem.currentStyle[ name ], style = elem.style; + var left, rsLeft, ret = elem.currentStyle && elem.currentStyle[ name ], style = elem.style; // From the awesome hack by Dean Edwards // http://erik.eae.net/archives/2007/07/27/18.54.15/#comment-102291 |