I am not good at jQuery so I am not sure if my assumptions are corrent.
I am using the isotope plugin, with which I want to insert elements one by one (and not every
Because .each()
runs pretty instantaneous for each entry, you'll end up with a bunch of timeouts which are more or less the same. So after about 3 seconds, all timeouts expire and the items are added.
To prevent this, you'll to make the timeout dependent on the index of the item. So item 0 will be inserted after 3 seconds, item 1 will be inserted after 6 seconds, etc.
$("#items_are_here").find('.item').each(function( index ) {
var item = $(this);
setTimeout(function() {
$('#container').isotope('insert', item);
},3000 * (index + 1));
});