diff options
author | John Resig <jeresig@gmail.com> | 2009-07-19 13:21:51 +0000 |
---|---|---|
committer | John Resig <jeresig@gmail.com> | 2009-07-19 13:21:51 +0000 |
commit | 0d5c3a68a092401089c9242bdafdb1b2534feb6a (patch) | |
tree | 0b52439fb625115252239bbbf66cfc39d0fae9ae /src/css.js | |
parent | a3b8ac413f9c55994922c20b39223ab9ae6d1afa (diff) | |
download | jquery-0d5c3a68a092401089c9242bdafdb1b2534feb6a.tar.gz jquery-0d5c3a68a092401089c9242bdafdb1b2534feb6a.zip |
Standardizing on .test() and .exec() - moving away from using .match() for RegExp. Fixes jQuery bug #4113.
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 94a021b6a..2395bdf59 100644 --- a/src/css.js +++ b/src/css.js @@ -75,7 +75,7 @@ jQuery.extend({ } return style.filter && style.filter.indexOf("opacity=") >= 0 ? - (parseFloat( style.filter.match(/opacity=([^)]*)/)[1] ) / 100) + '': + (parseFloat( /opacity=([^)]*)/.exec(style.filter)[1] ) / 100) + '': ""; } @@ -129,7 +129,7 @@ jQuery.extend({ // IE uses filters for opacity if ( !jQuery.support.opacity && name === "opacity" && elem.currentStyle ) { - ret = (elem.currentStyle.filter || "").match(/opacity=([^)]*)/) ? + ret = /opacity=([^)]*)/.test(elem.currentStyle.filter || "") ? (parseFloat(RegExp.$1) / 100) + "" : ""; @@ -207,4 +207,4 @@ jQuery.extend({ for ( var name in options ) elem.style[ name ] = old[ name ]; } -});
\ No newline at end of file +}); |