From ec3ebd3e8a7dfda15d227ea3dd21361e534beac3 Mon Sep 17 00:00:00 2001 From: Brandon Aaron Date: Thu, 14 May 2009 14:44:31 +0000 Subject: [PATCH] opacity is now retrieved from stylesheet in IE. fixes #3981 --- src/css.js | 12 +++++++++--- test/index.html | 3 +++ test/unit/css.js | 6 +++++- 3 files changed, 17 insertions(+), 4 deletions(-) diff --git a/src/css.js b/src/css.js index f77497b4f..12f9d514e 100644 --- a/src/css.js +++ b/src/css.js @@ -120,12 +120,18 @@ jQuery.extend({ }, curCSS: function( elem, name, force ) { - var ret, style = elem.style; + var ret, style = elem.style, filter; // IE uses filters for opacity if ( !jQuery.support.opacity && name == "opacity" ) { - ret = style.filter && style.filter.indexOf("opacity=") >= 0 ? - (parseFloat( style.filter.match(/opacity=([^)]*)/)[1] ) / 100) + '': + filter = (filter = style.filter) && filter.indexOf("opacity=") >= 0 ? + filter : + (filter = elem.currentStyle[ 'filter' ]) && filter.indexOf("opacity=") >= 0 ? + filter : + null; + + ret = filter && filter.indexOf("opacity=") >= 0 ? + (parseFloat( filter.match(/opacity=([^)]*)/)[1] ) / 100) + '': ""; return ret === "" ? diff --git a/test/index.html b/test/index.html index 634dacbd0..dfd46fbef 100644 --- a/test/index.html +++ b/test/index.html @@ -4,6 +4,9 @@ jQuery Test Suite +