【问题标题】:IE8:Image disappearing while rotating using jQuery RotateIE8:使用 jQuery Rotate 旋转时图像消失
【发布时间】:2013-05-19 16:53:09
【问题描述】:

我们有一个图像,它在旋转时似乎消失了一秒钟。这个问题存在于 IE8 中,并且在 IE9 和其他支持 HTML5 的浏览器中运行良好。我们使用了 jQuery 旋转插件。

HTML

<img id="obj" src="obj.png"/>

CSS

#obj {
    position:absolute;
    left: 196px;
    top: 94px
}

JS

       $("#obj").animate({
                left: 5,
                top: 232
          }, {
                duration: 700,
       });
       $("#obj").rotate({
                angle: 0,
                animateTo: -64,
                duration: 2000
       });

请提出相同的建议。

【问题讨论】:

  • 不确定,但可能是duration:700 后面的逗号?

标签: jquery html css internet-explorer-8 rotateanimation


【解决方案1】:

你可以简单地这样做

CSS:

 $("#obj").mouseenter(function(){
 $(this).css("transform","rotate(-720deg)");
 $(this).css("transition","400ms");
 $(this).css("z-index","1");
});
$("#obj").mouseleave(function(){
 $(this).css("transform","rotate(0deg)");
 $(this).css("z-index","0");
});

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2012-01-03
    • 2011-12-06
    • 1970-01-01
    • 1970-01-01
    • 2012-12-09
    • 2021-09-01
    相关资源
    最近更新 更多