/* fRedirectAndFadeWebsiteOut() ============================ Redirects to a new page and fades the website out, this is only done if the animation is enabled, otherwise the links work as they would by standard */ function fRedirectAndFadeWebsiteOut( sURL ) { // Fade the header container out TweenMax.to("body", 0.4, { opacity : 0, ease : Power2.easeOut } ); // After the animation has ended setTimeout(function () { // Redirect window.location = sURL; }, 400); } /* LOCAL COTNAINED WRAPPER ======================= Put all code here that you don't need to be accessed from the global scope of the website */ (function () { /* On Document Loaded ================== Called by Jquery event handler when the document is ready (When content has been loaded) */ $( document ).ready( function() { // Fade the website in fFadeWebsiteIn(); // If we are not on the homepage if( !$("#homepage-div").length ) { // Fade the navigation in TweenMax.to(".navigation", 0.6, { opacity : 1, ease : Power2.easeIn, delay : 0.25 } ); } }); /* fFadeWebsiteIn() ================ This function is called when the website first loads, it simply fades the header container in */ function fFadeWebsiteIn() { // Fade the body in TweenMax.to("body", 0.5, { opacity : 1, ease : Power2.easeIn } ); } }());