I have a site which loads a couple of Jquery animations on a page load. What I cant figure out is how to play a .fadeOut animation on the content when a link is clicked and before the new page is loaded. Any suggestions?
Pass a callback to fadeOut() that loads the new page after the animation completes.
I can make the animation work but I don’t know which function to use to get the new page to load.
see
window.location.href
and also
window.location.replace()
pick the appropriate one for your use.
Here’s what I have so far. Am I completely wrong?
<script type="text/javascript">
//Intial Load in animations
$(document).ready(function() {
$("#wrap").slideDown(1700, function() {
$("#footer").fadeIn("slow");
});
});
//load out animations
$('a').bind('click', function() {
$("#wrap").slideUp(1700, function(){
$("#footer").fadeOut("slow");
//add an extra function as callback that loads the page?
});
});
</script>
I’m quite new to Jquery as you can probably see.