logo       

[jQuery] Re: Removing element from DOM after animate: msg#02900

jQuery

Subject: [jQuery] Re: Removing element from DOM after animate

here is a chain of animation
$(this).parents(".leftbox:first")
 .animate({opacity: 0.5}, 350)
 .animate({opacity: 0}, 350)
 .remove();

you are actually chaining your events to occur one after the other on a specific element or group of elements

in the first piece of code you shared you. it would want to remove the element as it animates, not after.

On Fri, Jul 31, 2009 at 5:59 PM, bittermonkey <brakes2k3@xxxxxxxxx> wrote:

Please tell me why the remove() doesn't work from this call:
$(this).parents(".leftbox:first").animate({height:"hide",
opacity:"hide"}, 350, "", function(){$(this).remove()});


while this one works:
$(this).parents(".leftbox:first").animate({height:"hide",
opacity:"hide"}, 350).remove();


Thanks in advance.

Google Custom Search

News | Mail Home | sitemap | FAQ | advertise