Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    Regular Coder tpeck's Avatar
    Join Date
    Oct 2002
    Location
    Sydney, Australia
    Posts
    876
    Thanks
    53
    Thanked 6 Times in 5 Posts

    page loader splash requires override button

    Without wishing to get into a debate about the rights and wrongs of splash pages, I have found a method which works just the way I require except for one thing - it sets a timeout for vanishing instead of allowing the user to hit a button to make it vanish.

    The idea is to display a PAGE LOADING graphic and have the large page load in the background.

    Code:
    <body>
    <div id="slowScreenSplash" style="position:absolute;z-index:1;top:0px;left:0px;width:1001px; height:1001px; background-color:#000000">
    <script>
    showImage();
    </script>
    </div>
    
    ...page stuff to load goes here...
    
    <script>
    setTimeout("document.getElementById('slowScreenSplash').style.display = 'none'",10000);
    </script>
    
    </body>
    The showImage() routine allows for a random image to be displayed and works well. The SetTimeout line displays the graphic for 10 secs.

    But what I would really like is to have the option to allow, say, at least 10 secs to elapse before the loader vanishes OR a button to press that overrides this wait.

    Does anyone know how this could be achieved?

    Thanks
    The difference between genius and stupidity is that genius has its limits. (Albert Einstein)

  • #2
    Senior Coder
    Join Date
    Mar 2005
    Location
    Portsmouth UK
    Posts
    4,518
    Thanks
    3
    Thanked 506 Times in 493 Posts
    Code:
    <input type="button" name="" value="Clear Splash" onclick="document.getElementById('slowScreenSplash').style.display = 'none'" >
    Vic

    God Loves You and will never love you less.

    http://www.vicsjavascripts.org/Home.htm

    If my post has been useful please donate to http://www.operationsmile.org.uk/


  •  

    Posting Permissions

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