...

View Full Version : AGHHHHH! onMouseOver not working!



ScottInTexas
10-20-2003, 04:39 PM
There is absolutely nothing wrong with this.



function colorit(which){
which.style.color='red';
}

function uncolorit(which){
which.style.color='blue';
}


But it wont work. I have put alerts in them and they are being called. color is the real name of the property which is a property of the style.

If I use #FF0000 instead of red I get an 'invalid character' error.

Did I mispell which or something?

Roy Sinclair
10-20-2003, 05:12 PM
Two things:

1. We need to see an example link which uses those functions since the problem may not be in the functions themselves (IE, you may be calling them wrong).

2. The effect you are getting via javascript is more easily accomplished using just CSS alone and the CSS only solution will work for people who have javascript disabled.

-- for the stylesheet:
a.linkclassname { color: red; }
a.linkclassname:hover { color: blue; }

-- html:
<a href="yonderpage.htm" class="linkclassname">Yonder</a>



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum