I would like to repeat the chained events starting at .animate() from inside itself (indicated by 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")) })
//would like to call function at this stage
});
})
This 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();
});
});