开发者

How to add a new Row in a table with animation using jQuery?

开发者 https://www.devze.com 2022-12-14 14:13 出处:网络
This is what i am doing to add new Row in table:- function expandAll(){ $(\'#myTableID>tbody>tr>td:nth开发者_开发知识库-child(2)>div:nth-child(2)\').each ( function() {

This is what i am doing to add new Row in table:-

function expandAll(){
        $('#myTableID>tbody>tr>td:nth开发者_开发知识库-child(2)>div:nth-child(2)').each ( function() {
            html = $(this).html();
// Is it possible to add this Row with animation
            $(this).parent().parent().after( "<tr><td colspan='2'>&nbsp;</td><td colspan='15'>" + html + "</td></tr>" ).slideDown('slow');          
        } );
    }

I am able to add new Row, but there is no effect of using slideDown .


If you have JQuery 1.3.2, you can do this:

$("<your row html>").hide().insertAfter($(this).parent().parent()).slideDown('slow');
0

精彩评论

暂无评论...
验证码 换一张
取 消