开发者

How to slide a table down to one row in jQuery?

I'm trying to be fancy schmancy with my table. When I click a row, I want all the rows above and below to slide upwards, except the clicked row. So when the slide is finished, the t开发者_Python百科able should have only one row, the clicked one.

I have tried several versions of selecting all rows except the one i want, but everything is hidden :/

Any suggestions?


Here's a working demo.
You just have to select all the tr's siblings and hide/animate them.
You can use jquery's built-in slide functions :

$('tr').click(function(){
    $(this).siblings('tr').slideUp(); 
});
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜