views:

601

answers:

1

Hello,

I have a question about how too keep one event perform an action without being canceled by the next line off code In this case I don't want the remove action cancel the hide behavior

Maybe, this falls into the category off callbacks, but I am not sure if I can use it in this case

the code beneath already resides in the callback off a load method

this is the code

$(".frmtbnote:last").submit(function(){
    $(this).parents(".paneltbnote").animate({ opacity: 'hide' }, "slow");
    $(this).parents(".wrappertbnote").remove();

         $.post("tbnotesact.php",{
     noteid: $tbnoteid,
     action: "remove",
     time: timestamp
             }, function(xml) {
          // do something


    });
    return false;
});

thanks, Richard

+3  A: 

I believe a callback is what you are after

$(this).parents(".paneltbnote").animate({ opacity: 'hide' }, "slow", function(){
    $(this).parents(".wrappertbnote").remove();
  }
);
Corey Downie
Aaargh 3 seconds too slow!
Mike Robinson
thanks, I will try that