@Robert The code didn't work for me. @Charlie I tried length=0 and length=1 and the pane always goes past the footer div.
$(".pane .arrowdown").click(function() { if($(this).next().length==1) { // charlie: will return true if at bottom, would have to test after the animation, or use length==1 if test before animation $(this).css("visibility","hidden"); return; } else { $(this).parents(".pane").slideUp("slow",function(){ $(this).insertAfter($(this).next()).slideDown("slow"); }); return false; } });