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();
});
精彩评论