Hello,
I am having a set of 150px width DIV's next to each other, that all animate as a whole from right to left. The amount of DIVs varies, and i want to have the animation look the same speed with 1 DIV or with 10.
Since each DIV is 150px width, i currently have the animation speed based on the amount of DIV's:
Code:
aantal = $('#scroller div').size();
var speed = 8000;
snelheid = speed * aantal;
$('#scroller').animate({marginLeft: "-"+links+"px"}, snelheid, "linear");
#scroller is the container DIV that contains all 150px width DIVs.
I still notice that 1 DIV moves quite a bit faster then when i have 4 DIV's. How would i make the speed constant, no matter how many DIV's i have?
thanks!
Matt
|