谷歌浏览器中的谷歌Chrome jQuery动画滞后

时间:2011-12-15 16:10:39

标签: jquery css google-chrome animation position

我需要使用jQuery顺利移动对象。我正在使用.animate()方法。我正在制作它的position属性。它几乎可以在任何地方使用,但Chrome中没有动画元素。

$('#element').animate({
    'left': '+=' + 400 + 'px'
}, 800);

如何正确制作动画?

1 个答案:

答案 0 :(得分:1)

设置边距动画似乎可以完成工作。只需使用:

$('#login').animate({
    'margin-left': '+='+screen.width*2+'px'
}, 800, function(){ $('#login').addClass('inv'); });
$('#register').animate({
    'margin-left': '-150px'
}, 800);