Forums

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
    Posts
  • #148099
    redtaz
    Participant

    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=”www.pikappuci.com/jquery-1.10.2.min.js” >< /script >
    < script type=”text/javascript” >
    $(document).ready(function() {

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

    $(‘body’).fadeIn(1000);

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

    event.preventDefault();

    newLocation = this.href;

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

    });

    function newpage() {

    window.location = newLocation;

    }

    });
    < / script>`

    I assumed this code would be correct to get my webpage: http://pikappuci.com/testing/test.html 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!

    #148110
    Senff
    Participant

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

    #148113
    redtaz
    Participant

    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?

    #148114
    redtaz
    Participant

    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.