need a way to delay page load

Discussion in 'HTML & Website Design' started by Rodder7, May 7, 2009.

Thread Status:
Not open for further replies.
  1. #1
    I am doing the site in html, but before the javascript loads the page looks like puke. Is there a javascript/php way to either delay displaying the page until it loads or load the javascript completely and then the page.


    Thanks for any help--
     
    Rodder7, May 7, 2009 IP
  2. Aaron Sustar

    Aaron Sustar Peon

    Messages:
    38
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #2
    My first idea is the following ... Set the body in your HTML page like this:
    <body style="display:none;">
    HTML:
    Then you use a bit of JavaScript magic (I really hope you are using jQuery - if you are not, you should really look into that):
    $(document).ready(function() {
        $("body").fadeIn();
    }
    Code (markup):
    The effect is quite great, I tested it for you ... First the website loads and nothing is displayed, and once everything is ready, the whole website fades in (smoothly appears).

    I hope you like this solution. ;)
     
    Aaron Sustar, May 7, 2009 IP
Thread Status:
Not open for further replies.