jquery - 在 IE 中使用 Jquery 动画不透明度时,图像会被剪裁

标签 jquery jquery-animate

我使用下面给出的函数:

function rotate() {
            //Get the first image
            var current = ($('div#rotator ul li.show') ? $('div#rotator ul li.show') : $('div#rotator ul li:first'));

            //Get next image, when it reaches the end, rotate it back to the first image
            var next = ((current.next().length) ? ((current.next().hasClass('show')) ? $('div#rotator ul li:first') : current.next()) : $('div#rotator ul li:first'));

            //Set the fade in effect for the next image, the show class has higher z-index
            next.css({ opacity: 0.0 })
            .addClass('show')
            .animate({ opacity: 1.0 }, 1000);

            //Hide the current image
            current.animate({ opacity: 0.0 }, 1000)
            .removeClass('show');

        };

它可以幻灯片放映图像。它在 Firefox 和 Google Chrome 上运行完美,但在 IE 7 和 IE 8 中剪辑图像。非常感谢任何帮助。

提前致谢。

最佳答案

您使用的是哪个版本的 jquery?

尝试添加 IE 的不透明度值,如下所示:

//Set the fade in effect for the next image, the show class has higher z-index
next.css({ opacity: 0.0, filter: 'alpha(opacity=0)' })
.addClass('show')
.animate({ opacity: 1.0, filter: 'alpha(opacity=100)' }, 1000);

//Hide the current image
current.animate({ opacity: 0.0, filter: 'alpha(opacity=0)' }, 1000)

关于jquery - 在 IE 中使用 Jquery 动画不透明度时,图像会被剪裁,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2544664/

相关文章:

php - jQuery AJAX 调用时 POST 数组为空

javascript - 滚动时动画不起作用 - JQuery

javascript - 如何选择具有特定文本的框?

javascript - 将change() 和 contains() 与 HTML <select> (jQuery) 一起使用

javascript - 脉动点 JQueryUI,动画不工作

Javascript 翻转动画错误

javascript - 实现 prettyPhoto jQuery 插件

jquery - 简单的 jQuery 动画

jQuery 最接近();

jQuery 调用 CSS3 版本的 stop(true,false) 并从事件中制作动画?