Re: ok - still an issue with alt color links

by shortestpath <shortestpath(at)yahoo.com>

 Date:  Tue, 28 Oct 2003 19:31:02 -0800 (PST)
 To:  Web Alchemy Concepts <sales(at)webalchemy.on.ca>,
Hwg-Style <hwg-style(at)hwg.org>
 In-Reply-To:  on
  todo: View Thread, Original
woops- hit send too quick the first time... 
do you have sample html we can apply this to? 

--- Web Alchemy Concepts <sales(at)webalchemy.on.ca> wrote:
Ok,

I have most of this working now with alternate links but I have a 
script in
my nav menu that seems to ignore psuedo-classes.

a.submenu:link { color: #CC9933; text-decoration: underline;}
a.submenu:visited { color: #CC9933; text-decoration: underline;}
a.submenu:hover { color: #FFCC00; text-decoration: underline;}
a.submenu:active { color: #FFCC00; text-decoration: underline;}

I need this script below to behave with the above psuedo-class but 
instead
it defaults to my standard style: (this may not be the right group to 
post
to but here goes...)


<script type="text/javascript">

if (document.getElementById){
document.write('<style type="text/css">\n')
document.write('.submenu{display: none;}\n')
document.write('</style>\n')
}

function SwitchMenu(obj){
	if(document.getElementById){
	var el = document.getElementById(obj);
	var ar = 
document.getElementById("masterdiv").getElementsByTagName("span");
		if(el.style.display != "block"){
			for (var i=0; i<ar.length; i++){
				if (ar[i].className=="submenu")
				ar[i].style.display = "none";
			}
			el.style.display = "block";
		}else{
			el.style.display = "none";
		}
	}
}

</script>

-each menu item in my navigation menu is wrapped in a span with a 
unique id.
-everything works fine except for the color issue.
-in the head section of the page there is an inline style called 
submenu....

.submenu{
margin-bottom: 0.5em;
font-family: Arial, Helvetica, sans-serif;
	font-size: 10px;
	color: #FFFFFF;
	line-height: 12px;
}

(this is my standard style that the navigation menu defaults to)
a:link {  color: #CC9933; text-decoration: underline;}
a:visited { color: #957124; text-decoration: underline;}
a:hover {  color: #FFCC00; text-decoration: underline;}
a:active {  color: #FFCC00; text-decoration: underline;}

Think I have to change the script but not sure how...everything in the 
whole
navigation menu is wrapped in a master "div" tag.

Thanks,

Jeff

__________________________________
Do you Yahoo!?
Exclusive Video Premiere - Britney Spears
http://launch.yahoo.com/promos/britneyspears/

HWG hwg-style mailing list archives, maintained by Webmasters @ IWA