jquery 不透明度和 IE 的问题

发布于 2024-10-09 16:49:50 字数 479 浏览 10 评论 0原文

我有以下 jQuery 代码(lizzy-doll 是一个图像):

            var toTop = $('.lizzy-doll').css('top');

            $('.lizzy-doll').css('top', '-100px').css('opacity', '0');
            $('.lizzy-doll').animate({
                top : toTop,
                opacity : 1
            }, 2500);

这使我的图像从原来的位置向下移动并淡入,并且在除 IE 之外的所有浏览器中都可以正常工作,这里图像获得黑色背景(它是透明的 png 图像) )而不是淡入(幻灯片部分工作正常),我尝试添加 'filter' : 'alpha=xx' 以及但同样的问题。

有谁知道如何解决这个问题?

提前致谢。

I have the following jQuery code (lizzy-doll is an image):

            var toTop = $('.lizzy-doll').css('top');

            $('.lizzy-doll').css('top', '-100px').css('opacity', '0');
            $('.lizzy-doll').animate({
                top : toTop,
                opacity : 1
            }, 2500);

This makes my image move down from where it is and fade in and works fine in all browsers except IE, here the image gets a black background (its a transparent png image) instead of fading in (the slide part works fine), I tried adding 'filter' : 'alpha=xx' aswell but same problem.

Does anyone knows how to fix this?

Thanks in advance.

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

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

发布评论

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

评论(1

一个人练习一个人 2024-10-16 16:49:50

嘿,你解决这个问题了吗?看看在 css 中插入的内容是否修复了它:

.lizzy-doll { background: none !important; }

Hey, have you managed to fix this? See if this inserted in the css fixes it:

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