How to Use slideDown (or show) function on a table row?

后端 未结 21 2564
清歌不尽
清歌不尽 2020-11-22 09:03

I\'m trying to add a row to a table and have that row slide into view, however the slidedown function seems to be adding a display:block style to the table row which messes

21条回答
  •  刺人心
    刺人心 (楼主)
    2020-11-22 09:50

    I want to slide whole tbody and I've managed this problem by combining fade and slide effects.

    I've done this in 3 stages (2nd and 3rd steps are replaced in case you want to slide down or up)

    1. Assigning height to tbody,
    2. Fading all td and th,
    3. Sliding tbody.

    Example of slideUp:

    tbody.css('height', tbody.css('height'));
    tbody.find('td, th').fadeOut(200, function(){
        tbody.slideUp(300)
    });
    

提交回复
热议问题