jQuery的.animate()问题 [英] jQuery .animate() Issues

查看:279
本文介绍了jQuery的.animate()问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图使像功能的自动滚动/旋转木马为图像的无序列表。

I'm trying to make a autoscrolling/carousel like function for an unordered list of images.

当您将鼠标放在包含div它调用这是作业功能是动画在边际上的< UL>

When you mouse over the containing div its calling a function that's job is to animate the margin on the <ul>

$(".thumbs").animate({"margin-top": (currentMargin - 10) + "px"}, function(){
     console.log("margin-top" + (currentMargin - 10) + "px");
     running=false;
     });

我看到了什么,我想在日志中,即动画认为其最终的正确值......但没有正在改变我的DIV。

I'm seeing the correct value for what I want in the log ie the animation thinks its finished... but nothing is changing on my div.

没有人有任何见解,以什么可能作出预期的动画的功能不工作?

Does anyone have any insight as to what might make the animate function not work as intended?

感谢

推荐答案

尝试使用marginTop而不是的margin-top。通常,当您使用CSS道具为边境东西或保证金东西是更好地使用它的正常化的版本,因为你用来做什么的DHTML(styles.marginTop)。

try using "marginTop" instead of "margin-top". Normally when you use the CSS props as "border-something" or "margin-something" is better to use the "normalized" version of it, as you used to do it in DHTML (styles.marginTop).

这篇关于jQuery的.animate()问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆