How to get opacity value as an int for alpha filter?
For Internet Explorer opacity is set in inline css like this:
style="filter: alpha(opacity=50);"
What I'd like to do is get the opacity value 开发者_StackOverflow社区as in integer in javascript. Ok I guess I can get the whole string and parse out the int, but is there a faster/better way?
Thanks
The JavaScript is pretty simple:
var opacity = this.filters.alpha.opacity;
or if you have an id...
var opacity = getElementById('myelement').filters.alpha.opacity;
精彩评论