javascript - Remove table TR while maintaining addClass -


OK, I have a table TR which is removed when you press a button I use animate.css And I would like to add a class once my AJAX request is made. This line slides out, but then I need to delete the line

My javascript is as follows:

  $ ("delete"). Click (function () {var tr = $ (this) .closest ('tr'); var id = $ (this) .closest ('tr'). ('. Id') .html (); var datestring = 'Id =' + id; $ .ajax ({type: "POST", search) Url: "/ admin / deleteEvent /", data: data string, success: function () {$ (tr) .addClass ('animated BounceOutLeft '); $ (tr) .remove ();}})}};   

The part I focus on is:

  success: function () {$ (tr). AddClass ('animated bounceaut left'); $ (TR) .remove (); }   

Now, the table row now disappears, it seems to exclude part of the join square to slide this line. How can I remove the add class at the same time?

I do not think there is a callback, which you know when the ending of the closing ends.

Something like this:

  $ (tr). AddClass ('animated bounceaut left'); You can try using setTimeout to extract after small intervals. Window.setTimeout (function () {$ (tr) .remove ();}, 500);   

Here's a task (without all AJAX content)

Comments

Popular posts from this blog

ios - Adding an SKSpriteNode to SKScene from a child SKSpriteNode -

Matlab transpose a table vector -

c# - Textbox not clickable but editable -