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