I have this navigation menu:
<nav id="hoofd_menu">
<a href="portfolio/" title="Portfolio" target="_self" class="fade portfolio">Portfolio</a>
<a href="blog/" title="Blog" target="_self" class="fade blog">Blog</a>
<a href="over/" title="Over" target="_self" class="fade over">Over</a>
<a href="contact/" title="Contact" target="_self" class="fade contact">Contact</a>
</nav>
and this function:
$(document).ready(function(){
$("a.portfolio").click(function(e) {
e.preventDefault();
$('a.blog, a.over, a.contact').hide("slow");
$(this).animate({"opacity": "1"}, "slow");
$(this).hide("slow", function(){
document.location = $(this).attr('href');
});
});
});
Is it possible to change the function code so it works for all four links (without duplication of it)?
The function slowly hides the other links, after this is finished it slowly hide the link itself, and follows the href after this.