Mac Taylor
Mac Taylor

Reputation: 5158

problem in wordpress like delete rows in jquery

im trying to impelement a technique to delete stories with jquery animation exactly like wordpress

this is my script part :

$(function(){
 $('#jqdelete').click(function() {
  $(this).parents('tr.box').animate( { backgroundColor: '#cb5555' }, 500).animate( { height: 0, paddingTop: 0, paddingBottom: 0 }, 500, function() {
   $(this).css( { 'display' : 'none' } );
  });
 });
});

but not working am i wrong in any part of my code ?

Upvotes: 0

Views: 39

Answers (1)

Sarfraz
Sarfraz

Reputation: 382796

If there are multiple delete links, you should use a class instead of an id` for delete links:

<a href='javascript:void(0)' class='jqdelete'>

$(function(){
 $('.jqdelete').click(function() {
  $(this).parents('tr.box').animate( { backgroundColor: '#cb5555' }, 500).animate( { height: 0, paddingTop: 0, paddingBottom: 0 }, 500, function() {
   $(this).css( { 'display' : 'none' } );
  });
 });
});

Upvotes: 2

Related Questions