Skip to content

Instantly share code, notes, and snippets.

@kindy61
Created December 2, 2009 01:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kindy61/246856 to your computer and use it in GitHub Desktop.
Save kindy61/246856 to your computer and use it in GitHub Desktop.
//old
return style.filter && style.filter.indexOf("opacity=") >= 0 ?
(parseFloat( style.filter.match(/opacity=([^)]*)/)[1] ) / 100) + '':
"";
//new
return style.filter &&
(value = style.filter.match(/^\s*alpha\s*\(\s*opacity\s*=\s*(['"]?)\s*([0-9.]+)\s*\1\s*\)\s*$/i)) ?
(parseFloat( value[2] ) / 100) + '':
"";
//'\n\t ALPHA ( OPACITY= "\t 60.6 \n" ) ' works in ie.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment