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