Animated Record Deletion being choppy! Please help!

Animated Record Deletion being choppy! Please help!

 The code is working great except when you delete a record the animation is a bit choppy. I've only tested it in IE7.

I got this tutorial from David Walsh's website...

any suggestions??

live demo: http://www.rimdev.sgspoint.com/quality/index.php

 

PHP Page:

 
  1.  if(isset($_GET['delete']))
    {
     $sql2 = 'DELETE FROM table WHERE id = '.(int)$_GET['delete'];
     $result2 = mysql_query($sql2);
    }



  2. $sql = "SELECT * FROM table";
    $result = mysql_query($sql);
  3. while($row= mysql_fetch_array($result)) {
  4. echo '<DIV class=record id="record-',$row['id'],'">

  5. ',$row['id'],'

  6. <A class=delete href="?delete=',$row['id'],'" name="delete">Delete</A>
    </DIV>';


  7. }

JQuery Code:

 
  1.  $(document).ready(function() {
     $('a.delete').click(function(e) {
      e.preventDefault();
      var parent = $(this).parent();
      $.ajax({
       type: 'get',
       url: 'index.php',
       data: 'ajax=1&delete=' + parent.attr('id').replace('record-',''),
       beforeSend: function() {
        parent.animate({'backgroundColor':'#fb6c6c'},200);
       },
       success: function() {
        parent.slideUp(200,function() {
         parent.remove();
        });
       }
      });
     });
    });

















 

CSS:

 
  1.  .record { padding:10px 20px; background:#eee; border-top:1px solid #ccc; width:500px; font-size:13px}
    .delete   { color:#f00; display:block; width:40px; float:right; }