Forum Moderators: open

Message Too Old, No Replies

Link with timer

         

sammie94

12:26 pm on Aug 3, 2010 (gmt 0)

10+ Year Member



Hi everybody,

I need a code to for displaying a link on my webpage.
The link shouldn't be visible for the first 10 sec.
example:
the first ten seconds on the page is says : please wait ...seconds to continue and after ten seconds the link is displayed.
Thanks

Sam

rocknbil

4:22 pm on Aug 3, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Welcome aboard sammie94, you'll need Javascript to do this. Set the CSS selector on the paragraph or other parent container holding the link to display: none, then search down some timer scripts and show/hide div scripts.

G search on this site for javascript timers [google.com]

G search on this site for javascript show/hide [google.com]

enigma1

1:18 pm on Aug 13, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



If you don't want your js to be bypassed pretty much by everyone, you will need ajax to verify the 10 sec timer on the server-end as the later needs to decide whether or not to allow a link to be visible or present on a separate request.

And you can also add meta-refresh if you want it to work without js.

achshar

11:33 am on Aug 30, 2010 (gmt 0)

10+ Year Member




var s=10;
function changeSec() {
if(s>=0) {
document.getElementById('seconds').innerHTML=s;
s = --s;
setTimeout(changeSec, 1000);
} else {
document.getElementById('seconds').innerHTML='<a>foo</a>';
}
}


this is similar to what i use but it is for an unimportant purpose and this type of js can be 'cracked' easily, ajax would be a better solution as enigma1 mentioned above.. :)

And you can also add meta-refresh if you want it to work without js.

i believe meta refresh is also js..

tedster

3:08 pm on Aug 30, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Meta refresh and JavaScript are different technologies - meta refresh works even when you turn of JavaScript in the browser.

achshar

5:45 pm on Aug 30, 2010 (gmt 0)

10+ Year Member



oh sorry, me bad.. i had this notion that meta refresh needed js to work.. but hmm as it turns out i was wrong.. thanks :)