1 Page fade in and fade into another page Fri Apr 13, 2012 1:01 am
XDirect12345
Registered Member
Im sort of learning JQuery and I want to make a page fade transition, when someone clicks a link it fades to another page.
I think I got most of the code down but can anyone help me achieve the full effect I want?
- Code:
$(document).ready(function() {
$('body').css('display', 'none');
$('body').fadeIn(500);
$('.link').click(function() {
event.preventDefault();
newLocation = this.href;
$('body').fadeTo('slow', 0.5, newpage, function();
});
function newpage() {
window.location = newLocation;
}
});
I think I got most of the code down but can anyone help me achieve the full effect I want?