Treehouse: Grow your CSS skills. Land your dream job.

setTimeout with fadeIn & fadeOut? Help Needed Please

  • # August 10, 2012 at 4:32 am

    Howdy all,

    I’m using the bit of JS below to redirect an HTML page to another page after 2.5 seconds. The transitions are a bit harsh though and I am looking to integrate a fadeIn / fadeOut to the script. Please excuse my ignorance…this seems fairly easy, but I cant seem to solve it. Any help is much appreciated. Cheers.

    setTimeout(function() {
    window.location.href = "work.html";
    }, 2500);
    # August 10, 2012 at 5:13 am

    What about changing the url after whatever item has faded out? Make it take 2.5 seconds to fade out and change page directly afterwards

    window.location.href = "work.html";
    }, 2500);
    # August 10, 2012 at 6:22 am

    Hi jamy…just gave your code a try, didn’t quite seem to solve the issue. This caused the page to not change urls at all

    # August 10, 2012 at 7:55 am

    Oh right, your code above wouldn’t work either actually.

    It’s meant to be

    window.location = "work.html"

    not window.location.href

Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.