I want to slideUp one div after clicking a link, then slideDown another div, then go to the next page.
Problem: new page loads before the animations are finished.
Question: How can I do this?
Should I use preventDefault and then some way to resume it?
This is the URL: http://www.jolandaschouten.nl/wordpress
This is the code, which is now only implemented for the first menu item:
jQuery(document).ready(function($){
var allDivs = $("#introductie").add("#agenda").add("#werk").add("#onderwijs-organisatie").add("#publicaties").add("#links").add("#contact");
console.log(allDivs);
$("li.page-item-11 a").click(slideUp);
function slideUp(){
allDivs.slideUp(500, slideDown);
}
function slideDown(){
$("#introductie").slideDown(500);
}
});
ps: I don't want to use AJAX, because of SEO and browser navigation problems. The click should really result in going to the next page.