[Javascript] Anomolies

Rees, Mark (TWIi London) mrees at twii.net
Tue Aug 7 10:00:33 CDT 2001


Hello

the hover tag works for me provided you put the class in the anchor tag
(rather than in a font tag for example). Perhaps something further down the
stylesheet is overriding your A:hover.clsMnuItem declaration?

Mark

-----Original Message-----
From: Cutter Bl [mailto:cutterbl at hotmail.com]
Sent: 07 August 2001 02:06
To: javascript at LaTech.edu
Subject: [Javascript] Anomolies


Been playing around with a number of tricks for my site. One thing I don't 
understand is the behavior of the A:hover CSS attributes. If mouseover of 
the menu items on the left you will see the style changes which are supposed

to occur (red background, grey border, white text).

A:hover.clsMnuItem{
     backgound:red;
     border-width:thin;
     border-style:solid;
     color:white;
}
This appears to work on most of the items all of the time, but some of the 
items don't change the text color. Would I be better off applying these 
style changes through a javascript onmouseover?

function changeStyle(i){
     document.(somenameidentifier[i]).style.background = "red";
     document.(somenameidentifier[i]).style.border-width = "thin";
     document.(somenameidentifier[i]).style.border-style = "solid";
     document.(somenameidentifier[i]).style.color = "white";
}
function changeBack(i){
     document.(somenameidentifier[i]).style.background = "transparent";
     document.(somenameidentifier[i]).style.border = "none";
     document.(somenameidentifier[i]).style.color = "black";
}

<a href="mylink.html" onmouseover="changeStyle('1')" 
onmouseout="changeBack('1')" name="somenameidentifier1">my link</a>

I haven't tried this, just trying to get some feedback.

Cutter

The Past is a Memory
The Future a Dream
But Today is a Gift
That's why they call it
The Present


_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp

_______________________________________________
Javascript mailing list
Javascript at LaTech.edu
http://www.LaTech.edu/mailman/listinfo/javascript



More information about the Javascript mailing list