I would like to repeat chained events starting with .animate() from within myself (indicated by a comment). What is the correct way to write this?
$("div").each(function(i, e){ $(this).animate({ left: $(this).parent().width() }, d[i], "linear", function(){ $(this).css({left: -parseInt($(this).css("width")) })
It ended up working:
$("div").each( v = function(i, e){ $(this).animate({ left: $(this).parent().width() }, d[i], "linear", function(){ $(this).css({left: -parseInt($(this).css("width")) }) v(); }); });
source share