/ Published in: jQuery
A proper fade-to-background effect with jQuery, without caching problems.\r\n\r\nAmalgamation from different sources and help found on stackoverflow:\r\nhttp://stackoverflow.com/questions/3628459/jquery-page-transition-and-browser-history\r\nhttp://stackoverflow.com/questions/158319/cross-browser-onload-event-and-the-back-button/201406#201406
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
//on top of page $.ajaxSetup ({ // Disable caching of AJAX responses */ cache: false }); //fire jQuery when hitting the back button history.navigationMode = 'compatible'; //page effects $("body").css("display", "none"); $("body").fadeIn(1500); $("a.transition").click(function(event){ event.preventDefault(); linkLocation = this.href; $("body").fadeOut(500, function() { window.location = linkLocation; }); }); --- <body onunload=""> <!-- property to fix bfcache for firefox 3.5 -->