2009-11-12 40 views
0

我想打动一个div块顶端,所以我编写这样的:jQuery的块移动

CSS部分:

.movingPart{ 
margin-top:80px; 
} 

jQuery的一部分:

$(文件)。就绪(功能(){

$('#btn').click(function() { 


    $('.movingPart').animate({ 
     "margin-top":'0px' 

    }); 


}); 

});

它在Chrome中完美工作,但不会在Firefox中移动一点点,为什么?

在此先感谢

+0

[jQuery的.animate()问题]的可能重复(http://stackoverflow.com/questions/481288/jquery-animate-issues) – 2012-07-31 11:14:40

+0

看到http://stackoverflow.com/questions/481288/jquery -animate-问题 – 2009-11-12 12:39:07

回答

1

jQuery docs表明您应该使用动画时使用驼峰的性能。

请注意,属性应该是 指定使用驼峰的情况下,例如, “marginLeft”,而不是“margin-left”。