javascript - Don't run function until .hide() has finished its animation -


i have table updated ajax. when item deleted, want item hidden first, , table updated.

i thought achieved .hide() (example below), function inlineeditevent.update_table() being run instantly, , not waiting animation complete.

does know need make function doesn't fire until hide() has finished it's animation? thanks.

$(t.what+id).hide({     duration: 800,     done: inlineeditevent.update_table() // have tried 'complete' }); 

you need pass callback function reference done, not value returned update_table invoking it( adding () @ end of function name invoke it)

it should be

$(t.what+id).hide({     duration: 800,     done: inlineeditevent.update_table }); 

if want pass data

$(t.what+id).hide({     duration: 800,     done: function(){         inlineeditevent.update_table(1, 2, 3)     } }); 

Comments

Popular posts from this blog

php - Calling a template part from a post -

Firefox SVG shape not printing when it has stroke -

How to mention the localhost in android -