/    Sign up×
Community /Pin to ProfileBookmark

help seconds counter

Hello there i need script for my website , i’ve been trying to do it myself but failed as always , i’m gonna describe how it should work pretty well.

First of all 5 sec variable and counter from 5 to 0 in html text format.(5 SEC TO SKIP INFO)(4 SEC TO SKIP INFO)(ETC)

If there are more than 1 sec put that iframe :

[QUOTE]

<IFRAME FRAMEBORDER=”2″ MARGINWIDTH=0 MARGINHEIGHT=0 SCROLLING=NO WIDTH=100% HEIGHT=85% SRC=”info.html”></IFRAME>

[/QUOTE]

If there are less than 1 sec(0sec) switch iframe from up to :

[QUOTE]

<IFRAME FRAMEBORDER=”2″ MARGINWIDTH=0 MARGINHEIGHT=0 SCROLLING=NO WIDTH=100% HEIGHT=85% SRC=”$url”></IFRAME>

[/QUOTE]

I would be really thankful is someone could help me with that : d.

to post a comment
JavaScript

4 Comments(s)

Copy linkTweet thisAlerts:
@JMRKEROct 21.2011 — Something to consider...
<i>
</i>&lt;!DOC HTML&gt;
&lt;html&gt;
&lt;head&gt;
&lt;title&gt; Untitled &lt;/title&gt;
&lt;script type="text/javascript"&gt;

var otime = new Date();
var osec = otime.getMinutes()*1 + otime.getSeconds()*1;

function countDown() {
var ntime = new Date();
var nsec = ntime.getMinutes()*1 + ntime.getSeconds()*1;
var diff = nsec - osec;
if (diff &gt; 5) { return; }

if (diff == 4) {
document.getElementById('frm1').style.display = 'none';
document.getElementById('frm2').style.display = 'block';
}
if (diff &gt; 5) { return; } else {
document.getElementById('cdmessage').innerHTML
= (5-diff) + ' seconds to skip info';
timeCount = setTimeout('countDown()',1000);
}
}

var timeCount = setTimeout("countDown()",1000);

&lt;/script&gt;

&lt;/head&gt;
&lt;body&gt;
&lt;div id="cdmessage"&gt;5 seconds to skip info&lt;/div&gt;

&lt;div id="frm1" style="display:block"&gt;
&lt;!-- add this back in when available
&lt;IFRAME FRAMEBORDER="2" MARGINWIDTH=0 MARGINHEIGHT=0 SCROLLING=NO WIDTH=100% HEIGHT=85% SRC="info.html"&gt;&lt;/IFRAME&gt;
--&gt;
1st frame display
&lt;/div&gt;

&lt;div id="frm2" style="display:none"&gt;
&lt;!-- add this back in when available
&lt;IFRAME FRAMEBORDER="2" MARGINWIDTH=0 MARGINHEIGHT=0 SCROLLING=NO WIDTH=100% HEIGHT=85% SRC="$url"&gt;
&lt;/IFRAME&gt;
--&gt;
2nd frame display
&lt;/div&gt;

&lt;/body&gt;
&lt;/html&gt;
Copy linkTweet thisAlerts:
@kamazaki666authorOct 22.2011 — Awsome works perfectly , big thanks to you ?. I'll leave credits in html code of my page:rolleyes:.
[CODE] <!-- Thanks for seconds counter to JMRKER from webdeveloper.com -->[/CODE]
Copy linkTweet thisAlerts:
@JMRKEROct 22.2011 — Awsome works perfectly , big thanks to you ?. I'll leave credits in html code of my page:rolleyes:.
[CODE] <!-- Thanks for seconds counter to JMRKER from webdeveloper.com -->[/CODE][/QUOTE]


You're most welcome.

Happy to help.

Good Luck!

?
×

Success!

Help @kamazaki666 spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 6.16,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @nearjob,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,
)...