I was wondering is there any chance to grab href link with jQuery?
For example, I have these:
<li><a href="head.php">Head</a></li>
<li><a href="body.php">Body</a></li>
<li><a href="settings.php">Settings</a></li>
So I have made with jQuery some animation but I had to preventDefault();
So now on click of any of these <a> tags I get my fancy animation and thats it.
For index I was able to make it redirected because it is basically index.php so I have wrote following:
$('a#logo').on('click', function() {
setTimeout(function() {
window.location.replace('index.php');
}, 1100);
});
Now since it would be too much to make ID’s for every link and to write that with jQuery… it will be just way too much right?
So how can I tell jQuery… hey on click of specified <a> delay redirection for 1 second and then continue where you were before (redirect the page to specified href).
I hope you guys can understand me, and I truly hope that this is possible!
1 Answer