jquery不透明度跨浏览器?
jQuery('#selector').css({'opacity':50});
是跨浏览器吗?
上使用下面的行
我问的唯一原因是因为我们通常在 css -moz-opacity:.50; 过滤器:alpha(不透明度=50);不透明度:.50;
Is the the jQuery('#selector').css({'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;
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
这可能更好:
this is probably better:
是的,它设置 css 不透明度或 IE 的不透明度过滤器。
Yes, it sets the css opacity or IE's opacity filter.
因为 jQuery 在设计时就考虑到了跨浏览器兼容性,只要浏览器支持 CSS opacity 标签,那么,是的,您的 jQuery 代码就是跨浏览器的。 (您尝试过吗?您可以前往 jsfiddle.net 看看是否是这样。)
了解更多有关信息,请参阅有关不透明度的 W3Schools 页面。使用各种浏览器前往那里,看看它是否有效。 (看起来它在所有三种主要浏览器中都适用于我。)
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.)