Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Fade in a table row when it's added to a table

Tags:

jquery

I have the following code to add a new row to the end of a table:

$('.row-data:last').after('some HTML rows');

I want to use something like .fadeIn("slow") so each row fades in before it appears but I don't seem to be getting any animation:

$('.row-data:last').after('some HTML rows').fadeIn("slow");

Any ideas what I'm missing?

Thank you :).

like image 989
ale Avatar asked Feb 08 '12 13:02

ale


1 Answers

Try this:

var rows = $('some HTML rows');
rows.hide();
$('.row-data:last-child').after(rows);
rows.fadeIn("slow");

Example: http://jsfiddle.net/qdPAe/1/

like image 130
czerasz Avatar answered Sep 23 '22 10:09

czerasz