Click to See Complete Forum and Search --> : Link Activation Timer...


Knuckles
08-23-2004, 06:31 AM
Hi all, my first post here...

I'm looking for some help in sourcing or being aided in my quest for a script that will activate a timer between two links...

The page has two links on... LINK 1 which I want to be deactivated, and LINK 2 which is active

I want to have users click on LINK 2 and then for a timer to be set off which will enable users to click on LINK 1 after 5 - 10 seconds

Any help would be much appreciated

Thanks

Kor
08-23-2004, 06:53 AM
Try this (it will "activate" as you say the link in 5 secs - 5000 millisecs - you may modify for any time interval you want)


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script language="JavaScript" type="text/JavaScript">
function activate(){
document.getElementById('link1').setAttribute('href','link1.html')
}
onload=function (){document.getElementById('link1').setAttribute('href','#')}
</script>
</head>

<body>
<a href="link1.html" id="link1">link 1</a><br>
<a href="#" onclick="setTimeout('activate()',5000);return false">link 2</a>
</body>
</html>


If user has javascript disabled, the link is normal written.