...

View Full Version : Delay before timer starts



iambuxer
08-23-2010, 09:45 AM
Hello
I have a question, I bet it's easy for you guys.

I have a page "v.php" which's got an iframe that shows different pages for 3 seconds after they have loaded.

There is a page "w.php" that needs to be shown in the iframe but it needs to be shown for 10 seconds after it's loaded.

How can I make so "w.php" freezes the timer for at least 10 seconds and then let it start?


I hope you guys can understand.

Thanks!

Eldarrion
08-23-2010, 03:01 PM
How does the timer run in the first place? How is the page in question loaded? While we may be able to understand exactly what you're saying, we can't guess what your code looks like or how you're doing something. Please provide a code snippet next time.

iambuxer
08-24-2010, 02:30 AM
How does the timer run in the first place? How is the page in question loaded? While we may be able to understand exactly what you're saying, we can't guess what your code looks like or how you're doing something. Please provide a code snippet next time.

Thank you very much for your reply.

Here are the codes of the php which contains the iframe:


Javascript code:

<script type="text/javascript">
function include(file) {
var head = document.getElementsByTagName('head').item(0);
var old = document.getElementById('lastLoadedCmds');
if (old) head.removeChild(old);

script = document.createElement('script');
script.src = file;
script.type = 'text/javascript';
script.defer = true;
script.id = 'lastLoadedCmds';
void(head.appendChild(script));
}

var secs = ({$set['seconds']});
var tway=1;

function startTimer()
{
if(secs==0)
{
include("cmp.php?complete&amp;");
} else {
secs=secs-tway;
setTimeout("startTimer()", 1000);
}
document.getElementById('secs').innerHTML = secs;
}
</script>


The body:

<body style = "margin:0px; position:absolute; width:100%;" onload = "startTimer()">

And the iframe:

<iframe id="completedAd" src="{$url}" width="100%" frameborder="0" height="100%" style = "border-bottom: 0px solid #121212;border-left: 0px solid #121212;border-right: 0px solid #121212;" allowtransparency="true" scrolling="auto"></iframe>


I hope this helped :)

Thanks!



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum