views:

3784

answers:

3

I have this line of JavaScript and the behavior I am seeing is that the selectedLi instantly disappears without "sliding up". This is not the behavior that I expected.

What should I be doing so that the selectedLi slides up before it is removed?

selectedLi.slideUp("normal").remove();
+17  A: 

Might be able to fix it by putting the call to remove in a callback arg to slideUp?

e.g

selectedLi.slideUp("normal", function() { $(this).remove(); } );
seanb
A: 
selectedLi.slideUp(200, this.remove);
I tested - it doesn't remove element after sliding up.
Konstantin Spirin
A: 

I have another question based around this...

I can't figure the syntax so #introOverlay is removed after the animation?

$(function() { $("a.shift").click(function() { $("#introOverlay").animate({ height: 0, }, 2000) }); });
Martin
Please post another SO question instead of posting a question as an answer.
spoon16