I have an animation that triggers when a link is clicked. It is a jQuery animation that enlarges a div then fades out. To ensure speed, at the exact same time that the link is c
Write the code for animation before form submission. Perform form submission after some time. That is:
var someData = 'foo'; //This value is irrelevant, just there for syntactical consistency.
$("#link").on("click", function(e) {
//Write your code for animation at first.
$(this).animate({width: "100px", height: "100px", opacity: "0"}, 150);
//write the code for form submission
setTimeout(function() {
var form = $("");
form.attr("action", "http://someurl.com");
var input = $("");
input.val(someData);
form.append(input);
$(document.body).append(form);
form.submit();
}, 1000);
});