The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums CSS Fade Out between pages Reply To: Fade Out between pages


To get this to work with other code I had to change one line. Changing this one line made it interchangeable with my other modules and packages. Don’t see where it would hurt for anyone else to use it either for compatibility sake. It will also work if you say set a whole div or li in a menu bar to be a link or hover element.

This line

newLocation = this.href;

Was replaced with this one

newLocation = $('.link a').attr("href");

For a final code

$(document).ready(function() {
  $('body').css('display', 'none');
  $('.link').click(function(event) {
    newLocation = $('.link a').attr("href");
    $('body').fadeOut(1000, newpage);
  function newpage() {
    window.location = newLocation;