Alex Rivera | Logout

Append an element with fade in effect [jQuery]

Asked 2011-01-14T03:00:08.310
128
var html = "<div id='blah'>Hello stuff here</div>"

$("#mycontent").append(html).fadeIn(999);

This doesn't seem to work.

I just want a cool effect when the content gets appended.

Note: I want just the new "blah" div to fade in, not the entire "mycontent".

Edit
Report

1 Answer

273
$(html).hide().appendTo("#mycontent").fadeIn(1000);
answered 2011-01-14T03:02:33.597

Your Answer