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

Home Forums JavaScript Fade In/Out Pages

  • This topic is empty.
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
  • #148099

    Hello Everyone, I’m pretty new to Javascript so I am still trying to get a hold of it but am running into some difficulties trying to to get my sites page to fade in/out. I’ve set up the following code in the header of my page:
    < script type=”text/javascript” src=”” >< /script >
    < script type=”text/javascript” >
    $(document).ready(function() {

    $(‘body’).css(‘display’, ‘none’);


    $(‘.link’).click(function(event) {


    newLocation = this.href;

    $(‘body’).fadeOut(1000, newpage);


    function newpage() {

    window.location = newLocation;


    < / script>`

    I assumed this code would be correct to get my webpage: to fade-in and then fade-out once people click on ‘Continue to Site’ which would lead to our main site, but it doesn’t seem to work so I obviously did something wrong. If anybody could be of any help I would really appreciate ti!


    You forgot to add ‘http://&#8217; before the path to your jQuery library.


    Thanks Senff! Seems like that small little mistake was what was causing it not to work. That fixed the issue with the site fading in but once i click on “Continue to Site” it wont fade out, any idea what I may be doing wrong?


    Thanks for the help Senff! I was able to figure out my second issue, I forgot add set the class as transition but it’s all working now! :)

Viewing 4 posts - 1 through 4 (of 4 total)
  • The forum ‘JavaScript’ is closed to new topics and replies.