Skip to content

Instantly share code, notes, and snippets.

@stephenscaff
Created January 13, 2014 21:36
Show Gist options
  • Save stephenscaff/8408628 to your computer and use it in GitHub Desktop.
Save stephenscaff/8408628 to your computer and use it in GitHub Desktop.
Simple fade in on body and fade out via nav or link class. I usually use a the css for the fades and stuff, but this should do it....
$(document).ready(function() {
$("body").css("display", "none");
$("body").fadeIn(500);
$("nav a, a.suave").click(function(event){
event.preventDefault();
linkLocation = this.href;
$("body").fadeOut(500, redirectPage);
});
function redirectPage() {
window.location = linkLocation;
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment