开发者

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;
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜