you'll have to do some more to reset the visibility to visible on the up move of course. Was just steering you into one possible way to find the limits

Charlie wrote:
any tests on .arrowdown will not be of benefit , you need to check for position of it's parent .pane

since you are inserting after "p" tags in this case try this:

$(".pane .arrowdown").click(function() {
    $(this).parents(".pane").slideUp("slow",function(){
            $(this).insertAfter($(this).next()).slideDown("slow");
             if($(this).next("p").length==0) {   
                $(this).find(".arrowdown").css("visibility","hidden");
             }
        });
    return false;
});

Abbey wrote:
@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;
	}

});

  

Reply via email to