Click to See Complete Forum and Search --> : Inactive link to active link...


dmason165
03-10-2003, 11:21 AM
Hello All,

I was wondering if it is possible to have a link inactive and then become active after a specified amount of time.

If there is a script someone could provide that will do this, please do.

Thank you very much for your time and your help.

Sincerely,
~Darron

gil davis
03-10-2003, 11:35 AM
<script>
var active = false;
var timer = 4; // # of seconds inactive
setTimeout("active=true", timer * 1000);
</script>
<a href="whatever" onclick="return (!active)">something</a>

dmason165
03-10-2003, 01:01 PM
Hey Gil,

I know its a cold day in Hell when you remember me, but you helped me out on some JS problems over the summer last year!

Once again, a huge help!

Hope you're doin' good!

~Darron

Dan Drillich
03-10-2003, 02:35 PM
Gil,

I think it should be -


<a href="http://www.iwon.com" onclick="return (active)">something</a>

Dan Drillich
03-10-2003, 09:54 PM
You can also consider changing the color of the link when it becomes active, or _maybe_ hide it all together until the moment comes ;-)


<script>
var active = false;
var timer = 4; // # of seconds inactive
setTimeout("active=true; window.document.links[0].style.color='blue'; document.links[0].style.visibility = 'visible'; ", timer * 1000);
</script>

<a style="color: red" href="http://www.iwon.com" onclick="return active;">something</a>

<script>
document.links[0].style.visibility = 'hidden';
</script>


Cheers,
Edmundo and Dan