Skip to content

Instantly share code, notes, and snippets.

@vielhuber
Last active September 22, 2017 23:12
Show Gist options
  • Save vielhuber/9f7f4ebe096d4f13d34e to your computer and use it in GitHub Desktop.
Save vielhuber/9f7f4ebe096d4f13d34e to your computer and use it in GitHub Desktop.
when both animation and post/load are finished, execute function #js
$.when(
$('.box').animate({ opacity: 0 }, 1000, 'linear'),
$.post( $(this).closest('form').attr('action'), $(this).closest('form').serialize() )
).then(function () {
alert('both finished');
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment