【问题标题】:images are getting clipped when Jquery animate opacity is used in IE在 IE 中使用 Jquery animate opacity 时,图像被剪裁
【发布时间】:2010-03-30 11:18:27
【问题描述】:

我使用下面给出的函数:

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 jquery-animate


【解决方案1】:

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

【讨论】:

    猜你喜欢
    • 2012-07-26
    • 1970-01-01
    • 1970-01-01
    • 2021-05-05
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多