View Full Version : Change div's after 10 seconds?
anversli
Feb 29th 2008, 4:25 pm
Hi,
Is it possible to change a div's after 10 seconds?
For example:
Display a banner for 10 seconds before loading the content and after 10 seconds hide banner and show content at the same place.
Wuiqed
Feb 29th 2008, 7:15 pm
That would be done with javascript. However, if the visitor has javascript turned off the ad (or the content, depending on how you've set it up) won't be served.
You could use an interstitial page with the ad and redirect the visitor to the content after 10 seconds, which is a quite common albeit annoying practice.
azizny
Feb 29th 2008, 7:31 pm
You could use iframe with meta tag refresh to a script.
Peace,
bartolay13
Feb 29th 2008, 7:32 pm
Do you refresh your page in every 10secs??
- if you do, it can be done in php itself, with a <meta refresh=10> tag.
other method.
This can be done with Ajax. only a target div container refreshes in 10 every 10 secs.
lephron
Mar 2nd 2008, 6:53 am
The javascript code to invoke a function after 10 seconds is:
setTimeout( function() { /* update div code here */ }, 10000);
To get that to run when the page loads do:
<script type="text/javascript">
window.onload = setTimeout( function() { /* update div code here */ }, 10000);
</script>
vBulletin® v3.8.4, Copyright ©2000-2009, Jelsoft Enterprises Ltd.