开发者

jquery opacity cross browser?

Is the the jQuery('#selector').c开发者_如何学Pythonss({'opacity':50}); cross browser?

The only reason i ask is because the line below that we'd normally use on css

-moz-opacity:.50; filter:alpha(opacity=50); opacity:.50;


this is probably better:

$(element).fadeTo(0, 0.5);


Yes, it sets the css opacity or IE's opacity filter.


Because jQuery is designed with cross-browser compatibility in mind, as long as the CSS opacity tag is supported in a browser, then, yes, your jQuery code is cross-browser. (Have you tried it out yet? You can head to jsfiddle.net to see if it is.)

For more information, here is the W3Schools page on opacity. Head there with various browsers and see if it works. (It looks like it works for me in all three major browsers.)

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜