I'm trying to make a autoscrolling/carousel like function for an unordered list of images.
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;
});
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?
Thanks
I'm trying to make a autoscrolling/carousel like function for an unordered list of images.
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;
});
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?
Thanks
Share Improve this question edited Jan 26, 2009 at 20:55 EndangeredMassa 17.5k8 gold badges56 silver badges81 bronze badges asked Jan 26, 2009 at 20:51 BirkBirk 2,1834 gold badges21 silver badges26 bronze badges1 Answer
Reset to default 17try 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).