Problems with jQuery.animate ()

I am trying to make the auto scroll / carousel function for an unordered list of images.

When you hover over a div containing its function call, the task of which is to wait for the field on <ul>

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

I see the correct value for what I want in the log, i.e. the animation thinks it's over ... but nothing changes on my div.

Does anyone have an idea of ​​what might make the revitalization function not work as intended?

thanks

+7
javascript jquery animation effects
source share
1 answer

try using "marginTop" instead of "margin-top". Usually, when you use CSS attributes like "border-something" or "margin-something", it is better to use the "normalized" version, as you did in DHTML (styles.marginTop).

+17
source share

All Articles