Go Back   CodingForums.com > :: Client side development > JavaScript programming

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 05-07-2007, 01:42 PM   PM User | #1
tpeck
Regular Coder

 
tpeck's Avatar
 
Join Date: Oct 2002
Location: Sydney, Australia
Posts: 771
Thanks: 40
Thanked 5 Times in 4 Posts
tpeck is on a distinguished road
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)
tpeck is offline   Reply With Quote
Old 05-07-2007, 04:49 PM   PM User | #2
vwphillips
Senior Coder

 
Join Date: Mar 2005
Location: Portsmouth UK
Posts: 4,355
Thanks: 3
Thanked 458 Times in 445 Posts
vwphillips is a jewel in the roughvwphillips is a jewel in the roughvwphillips is a jewel in the rough
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.uk/

If my post has been useful please donate to http://www.operationsmile.org.uk/
vwphillips is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 08:15 AM.


Advertisement
Log in to turn off these ads.