0

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 ?

1
  • I'd suspect that this is because table rows do not have display: block but use a different display model and so these things tend to not work. Commented May 16, 2010 at 9:23

1 Answer 1

2

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' } );
  });
 });
});
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.