IE 中的 jQuery Masonry 和不透明度

发布于 2024-09-27 20:24:21 字数 196 浏览 3 评论 0原文

我发现如果我使用 jQuery masonry 并使用 jQuery 设置某些内容的不透明度,则不透明度在 IE 中不起作用。有趣的是,我有一个 div 设置为 fadeIn,它也有一个不透明度值。在 IE 中淡入淡出时,div 是半透明的,但淡入结束后,它就会变成固体。这很奇怪,我找不到解决办法。尝试使用半透明 PNG,但这些在 IE 中不会正确淡出。

谢谢

I have found that if I am using jQuery masonry and also use jQuery to set the opacity of something, the opacity does not work in IE. The funny thing is that I have a div set to fadeIn, which also has an opacity value. The div IS translucent when fading in IE, but as soon as the fade has finished it just becomes solid. This is very strange and I cannot find a fix. Tried using an translucent PNG but these will not fade correctly in IE.

Thanks

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

故事↓在人 2024-10-04 20:24:21

这是一个非常常见的错误。这是 IE 的问题,而不是 jQuery 的问题。幸运的是,IE9终于有了真正的不透明支持。不幸的是,大量用户仍在使用 IE7(和 IE6!!)。

我曾经用褪色的 PNG 构建了一个超级可爱的 jQuery 界面。 PNG 使用不透明度级别来保持事物看起来不错。在 IE 中,不透明像素为纯黑色。

我已经在这个主题上做了很多谷歌搜索,除了不褪色不透明的 PNG 之外没有其他解决方法。

事实上,这些修复对我不起作用,但也许对你有用:

http://blog.pengoworks.com/index.cfm/2009/2/17/Fading-a-24bit-transparent-PNG-in-IE7

This is a very common bug. It's a problem with IE, not jQuery. Fortunately, IE9 finally has true opacity support. Unfortunately, Butt-Loads of users are still using IE7 (and IE6!!).

I once built a super sweet jQuery interface with fading PNGs. The PNGs used levels of opacity to keep things looking nice. In IE the opacity pixels were solid black.

I've done a LOT of googling on the topic, and there's no workaround other than not fading a PNG with opacity.

Actaully, these fixes didn't work for me, but maybe they will for you:

http://blog.pengoworks.com/index.cfm/2009/2/17/Fading-a-24bit-transparent-PNG-in-IE7

热鲨 2024-10-04 20:24:21

好的,这就是我必须做的。使用带有不透明度和过滤器的 css 设置 div 的不透明度(对于 corss 浏览器)。 fadeIn div(因为它是隐藏的)。现在在 IE 中,由于某种原因,淡入淡出后,不透明度将关闭,因此您必须再次使用 jQuery css 不透明度重置它,这是代码:

$('.project .blue').delay(300).fadeIn(800) .css({"不透明度":.3});

很简单,但它总是你最后想到的。

Ok, so here is what I had to do. Set the opacity of the div using css with both opacity and filter (for corss-browser). The fadeIn the div (because it is hidden). Now in IE for some reason after fading the opacity will turn off, so you have to reset it using jQuery css opacity again, this is the code:

$('.project .blue').delay(300).fadeIn(800).css({"opacity":.3});

Quite simple, but it's always the last thing you think of.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文