It appears you have not yet registered with our community. To register please click here...


css / javascript problems

This 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 ...


Reply
 
Postbit Seperator LinkBack Thread Tools Postbit Seperator Display Modes
Old 05-11-2007, 07:13 PM   #1 (permalink)
 
Status: Junior Member
Join Date: May 2007
Posts: 1
Trader Rating: (0)
ollio is on a distinguished road
TD$: 0.00
Donate
Default css / javascript problems
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
ollio is offline   Reply With Quote
Table Bottom LeftTable BottomTable Bottom Right
Reply


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


Home | Site Map | Contact | Archive | Top

 

Copyright © 2007 - 2010 iTalkWebs Network

Search Engine Optimization by vBSEO 3.1.0