PDA

View Full Version : Not A Simple Mouseover Text Color Change



rtrinidad
04-01-2009, 05:06 PM
There may be a simple answer to this but I don't know it. This is similar to a simple css hover color change with a twist.

I have a list of 10 text links colored blue. I need the text color to change to red when a user hovers over it. Now for the tricky part. I need for this link to remain red once the user moves the cursor from the text.

When the user hovers over another link, I need that link to turn red and the previously hovered link to reset to blue.

Anyone know a simple way to accomplish this?

vwphillips
04-02-2009, 08:42 AM
<html>

<head>
<title></title>
<script type="text/javascript">

var Lst=false;

function Cng(obj){
if (Lst) Lst.style.color='blue';
Lst=obj;
Lst.style.color='red';
}

</script>

</head>

<body>
<a onmouseover="Cng(this);" >Tom</a>
<br />
<br />
<a onmouseover="Cng(this);" >****</a>
<br />
<br />
<a onmouseover="Cng(this);" >Harry</a>
</body>

</html>