Hi! Anyone can help in enabling and disabling a hyperlinks?
I found this script but it wont fit my need so it needs to be fix. Any help is much appreciated. Thanks in advance!
Here is the scenario:Code:<script language="Javascript"> function disableAnchor(obj, disable){ if(disable){ var href = obj.getAttribute("href"); if(href && href != "" && href != null){ obj.setAttribute('href_bak', href); } obj.removeAttribute('href'); obj.style.color="gray"; } else{ obj.setAttribute('href', obj.attributes ['href_bak'].nodeValue); obj.style.color="blue"; } } </script> <body> <a href="testing.html" onclick="javascript:disableAnchor(this, true)">individuals</a> | <a href="#" onclick="javascript:disableAnchor(this, true)">groups</a> </body>
I have 5 links namely Home | Pre-test | Lesson | Post-test | About. On load of my page only the following are hyperlink enabled Home, Pre-test and About. When the user will click the Pre-test link, Page will display containing a .swf file where the user will take a test. In that same page is a link going back to Home page. I'd like that when the user clicks the Home link in the Pre-test page, the Home Page will display but the Lesson link is now enabled and the Pre-test link is now disabled.
Now that the Lesson link is enabled. My other concern is after the user had read the lesson, how should i enable the Post-test link and disable the Lesson link.
Summary of links:
First load of the page links enabled are:
Home | Pre-test | Lesson | Post-test | About
After Pre-test's Home link is clicked:
Home | Pre-test | Lesson | Post-test | About
lastly, after reading the lesson:
Home | Pre-test | Lesson | Post-test | About



Reply With Quote

Bookmarks