I recommend a jQuery user do this
This is a jquery animation API document
You can easily achieve the following:
$('.project_box').animate({ width: '100px' }, 5000, function() {
In your case, the animation is one after another:
var childArray = new Array(); $(". project_box").each(function(){ childArray.push($(this)); }); runAnimation(); int count = 0; function runAnimation(){ childArray[0].animation({ width: '100px' }, 1000, function(){ if(++count < childArray.length) runAnimation(); }); }
PS: I have not tried, but the structure is fine, you are trying to follow the structure: D
source share