I have written a script to slide a div horizontally and stop at a specific margin-left value.
The margin left depends on the link which was clicked, so I have used a calculation to find that specific value. When i try to pass the variable into the .animate({"margin-left":value},"slow");
Here is the code
var marginLeft = parseInt((linkClick * 995)-995)+"px";
$("div_to_animate").animate({
"margin-left":marginLeft},"slow");
I have used the code below to ensure that it is returning the correct value
alert(marginLeft);
Any suggestions?
Thanks