0
我有一个jQuery动画,可以在除Safari以外的所有浏览器(仅在Windows 7上测试过)中平滑呈现。jQuery动画在Windows上的Safari浏览器不平滑
重要的是它会支持Safari。任何人都知道这是为什么?
顺便说一句,这不是我第一次遇到这个问题。
这是我使用的代码:
setInterval(function() {
nextObstacle = createObstacle();
animateLoops(nextObstacle,direction);
direction = (direction == '+=3') ? ('-=8') : ('+=3');
}, 2000);
function animateLoops(o,direction) {
o.animate ({
'top': '+=1',
'left': direction,
'height': '+=5',
'width': '+=5'
}, 100, 'linear', function() {
if (o.outerWidth()<200) // keep moving
animateLoops(o,direction);
else { // check success
o.fadeOut();
}
});
}
<style>
#game-div {
width:590px;
height:700px;
background: url(images/background-1604.png);
position:relative;
/* cursor: url(images/plane-1604.png), auto;*/
}
.loop {
position:absolute;
top:230px;
left:270px;
width: 30px;
height:30px;
}
</style>
你可以看到它住在这里:http://www.israelinsidethemovie.com/plane-game/
Bruv **一)**定义平滑? :)我在safari OSX狮子和除了那些黑色粗圆圈看起来光滑:))欢呼 – 2012-04-17 09:47:35
我认为定义这种光滑度问题的最佳方式是这样的:在铬看起来好多了! – 2012-04-17 09:49:44