SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Wizard bronze trophy
    Join Date
    Apr 2003
    Posts
    4,095
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Loading message using CSS

    Hello everyone,

    I'm wondering if it's possible to make a "loading message" of sorts that appears before the rest of the page, and then disappears when the page loads. Any ideas?

    Thanks for your help.

    Compuwhiz7

  2. #2
    Sultan of Ping jofa's Avatar
    Join Date
    Mar 2002
    Location
    SvÝ■jˇ­
    Posts
    4,080
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Eh, yes, and no
    Depends on what you mean when you say "...when the page loads"

    You could, however, put the message in a visible div, hide the rest of the page, and after, let's say, 5 s run a javascript function that change css properties for the elements (i.e. hides / displays other divs)

  3. #3
    SitePoint Wizard bronze trophy
    Join Date
    Apr 2003
    Posts
    4,095
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hello everyone,

    Thanks for the help!

  4. #4
    Sultan of Ping jofa's Avatar
    Join Date
    Mar 2002
    Location
    SvÝ■jˇ­
    Posts
    4,080
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Even easier; redirect to another page after 5 s

  5. #5
    ********* Wizard silver trophy Cam's Avatar
    Join Date
    Aug 2002
    Location
    Burpengary, Australia
    Posts
    4,495
    Mentioned
    0 Post(s)
    Tagged
    1 Thread(s)
    What about using the onLoad event on the BODY. Like
    Code:
    /* JS function */
    function hideDIV() {
       document.getElementById('loading').style.display = 'none';
    }
    
    <!-- HTML code -->
    <body onLoad="hideDIV">
    <div id='loading' style='width: 100%; height: 100%; text-align: center; vertical-align: middle;'>
    Loading...
    </div>


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •