Skip to content

Instantly share code, notes, and snippets.

@bologer
Created June 22, 2015 08:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bologer/04d42f81ae3de4e6a77b to your computer and use it in GitHub Desktop.
Save bologer/04d42f81ae3de4e6a77b to your computer and use it in GitHub Desktop.
//Source: http://stackoverflow.com/questions/467336/how-to-use-slidedown-or-show-function-on-a-table-row
// SlideUp
$('#my_table > tbody > tr.my_row')
.find('td')
.wrapInner('<div style="display: block;" />')
.parent()
.find('td > div')
.slideUp(700, function(){
$(this).parent().parent().remove();
});
// SlideDown
$('#my_table > tbody > tr.my_row')
.find('td')
.wrapInner('<div style="display: none;" />')
.parent()
.find('td > div')
.slideDown(700, function(){
var $set = $(this);
$set.replaceWith($set.contents());
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment