我使用下面给出的函数:
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/