I need to postpone a slight redirect to a new page after clicking on certain links.
Now I am using the following jQuery:
$('.menu-element a').click(function(){ var src = $(this).attr('href'); $(this).removeAttr('href'); anim(src); })
And it works great. It starts a very short animation and then redirects to the page with a click.
But I would like to keep the href attribute of the link (i.e. in case someone double-clicks twice).
when I add $(this).attr('href', src); at the end of the code indicated above, he does not wait until the animation finishes only redirecting to a new page immediately after clicking the link.
How to save the href property and avoid redirecting the page to a new address?
Gacek source share