The following code was designed to apply a procedure to all the child elements of containers before and after the one being clicked. It is broken in some way. I have never used nextAll or prevAll so it is probably related to bad coding.
$('.bounceholder ul').prevAll().each(function(){
$(this + ' li').each(function(){
$(this).animate({left: -200, top:-8, leaveTransforms:true}, 600);
});
});
$('.bounceholder ul').nextAll().each(function(){
$(this + ' li').each(function(){
$(this).animate({left: +1000, top:-8, leaveTransforms:true}, 600);
});
});
Where’s the problem
Try this: