Check out this simple JSFiddle (ignore all the javascript code, this question here is only about the animated loading GIF).
I want to show the animated loading GIF before a form gets submitted.
I tried this:
setTimeout(function(){
$('form[name="checkout-form"]').submit();
},1000);
And this works fine, the animated loading GIF appears for 1 second, however, it stops the animation as soon as the submit request has been sent.
What do I have to do in order to let the GIF animated until the page loads again (or until the response comes back from the page?)