Digital Point Forums
Wester Union

Go Back   Digital Point Forums > Design & Development > Programming > PHP
Google Analytics
Log In to view
your analytics

Reply
 
Thread Tools
  #1  
Old Feb 29th 2008, 4:25 pm
anversli's Avatar
anversli anversli is offline
Hand of A'dal
 
Join Date: Sep 2006
Posts: 295
anversli is on a distinguished road
Change div's after 10 seconds?

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.
Reply With Quote
  #2  
Old Feb 29th 2008, 7:15 pm
Wuiqed's Avatar
Wuiqed Wuiqed is offline
Champion of the Naaru
 
Join Date: Feb 2008
Location: Sweden
Posts: 110
Wuiqed is on a distinguished road
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.
Reply With Quote
  #3  
Old Feb 29th 2008, 7:31 pm
azizny's Avatar
azizny azizny is offline
Starcaller
 
Join Date: Jul 2006
Location: USA
Posts: 2,607
azizny is a jewel in the roughazizny is a jewel in the roughazizny is a jewel in the roughazizny is a jewel in the rough
You could use iframe with meta tag refresh to a script.

Peace,
__________________
Testing 1.. Testing 1..2.. Testing 1..2..3..
Reply With Quote
  #4  
Old Feb 29th 2008, 7:32 pm
bartolay13's Avatar
bartolay13 bartolay13 is offline
Hand of A'dal
 
Join Date: Nov 2007
Location: Philippines
Posts: 441
bartolay13 is on a distinguished road
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.
__________________
Programmers are in a race with the Universe to create bigger and better idiot-proof programs, while the Universe is trying to create bigger and better idiots. So far the Universe is winning.
Reply With Quote
  #5  
Old Mar 2nd 2008, 6:53 am
lephron lephron is offline
Champion of the Naaru
 
Join Date: Dec 2007
Posts: 199
lephron is on a distinguished road
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>
Reply With Quote
Reply

Bookmarks

Thread Tools

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Positioning Div's gbabula HTML & Website Design 3 Nov 8th 2007 7:37 pm
Some pixels between div's in IE? 123GoToAndPlay CSS 4 Sep 1st 2007 11:37 pm
div's in innerHTML gabs JavaScript 2 Mar 7th 2007 3:38 am
Div's in IE and FF lizzie87 HTML & Website Design 1 Jun 12th 2006 7:34 am
Massive weight change between two recalculations in 10 seconds kodeking Weight Questions 1 Dec 10th 2005 5:59 am


All times are GMT -8. The time now is 1:22 am.