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

时间:2010-03-30 11:18:27

标签: 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和谷歌浏览器上运行完美,但在IE 7和IE 8中剪辑图像。非常感谢任何帮助。

提前致谢。

1 个答案:

答案 0 :(得分:0)

您使用的是哪个版本的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)