jquery - IE8 :Image disappearing while rotating using jQuery Rotate

标签 jquery html css internet-explorer-8 rotateanimation

我们有一个图像,它似乎在旋转时消失了一秒钟。这个问题存在于 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
       });

请提出相同的建议。

最佳答案

你可以简单地通过

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");
});

关于jquery - IE8 :Image disappearing while rotating using jQuery Rotate,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16729016/

相关文章:

javascript - 如何在 Ajax 中弹出?

html - 使用 css 溢出滚动 div 内容

html - 如何用 css 停止 svg 动画?

javascript - 如果日期月份等于输入的隐藏值,则更改 div

javascript - 如何使用 javascript 或 selenium 获取给定 url 中的所有 cookie?

javascript - 单击 anchor 标记时获取当前行值

javascript - Jquery 函数在错误时间提交

html - 使用 Css calc() 对齐伪元素以在所有屏幕上工作

html - SVG 图像没有拉伸(stretch)到指定的大小

javascript - 如何在dom中制作一些特定值的字符串?