|
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() |
css / javascript problemsThis is a discussion on css / javascript problems within the HTML & CSS forums. Topic: hello i am making a wbsite with css, constructing it in divisions and i frames for opening links in different ... |
![]() |
![]() |
|
![]() |
LinkBack | Thread Tools | ![]() | Display Modes | ![]() |
|
|
#1 (permalink) |
|
hello
i am making a wbsite with css, constructing it in divisions and i frames for opening links in different divisions. i put all the attributes to the links (a, a:hover, a:visited.. ) and everything fine. then i added a javascript which says that the visited link color of the last clicked link shall change after clicking the next link. i used this code: <script type="text/javascript"> var lastClickedLink = null; function rememberLink() { if (lastClickedLink) {lastClickedLink.style.color = "#827B60";} lastClickedLink = this; this.style.color = "#F87217"; } function makeMemory() { for (var i=0; i<document.links.length; i++) { var link = document.links[i]; if (link.addEventListener) { link.addEventListener("click",rememberLink,false); } else if (link.attachEvent) { link.attachEvent("onclick",rememberLink); } else { link.onclick=rememberLink; } } } </script> the problem is that now all links appear in Blue!! i hope anyone knows to help... ollio |
|
|
|
|
![]() | ![]() | ![]() |
![]() |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Javascript: Prime or not | gehher | JavaScript and Java | 3 | 11-12-2008 06:59 AM |
| Postbacks without JavaScript? | Kolyn_Kryw | JavaScript and Java | 2 | 10-09-2008 08:50 PM |
| Memory problems | nocko | General Discussion | 0 | 07-11-2008 09:33 AM |
| quick javascript help | gurro | JavaScript and Java | 0 | 10-16-2007 08:26 AM |
| quick javascript help | Nikolas741 | JavaScript and Java | 0 | 07-25-2007 01:57 PM |