Click here to Skip to main content
15,912,457 members
Home / Discussions / Java
   

Java

 
GeneralRe: error in infix to postfix conversion Pin
WindowsVsLinux30-Jan-11 5:36
WindowsVsLinux30-Jan-11 5:36 
GeneralRe: error in infix to postfix conversion Pin
jschell30-Jan-11 9:46
jschell30-Jan-11 9:46 
QuestionPDF Annotator Pin
Civic0627-Jan-11 15:23
Civic0627-Jan-11 15:23 
AnswerRe: PDF Annotator Pin
David Skelly27-Jan-11 22:30
David Skelly27-Jan-11 22:30 
GeneralRe: PDF Annotator Pin
Civic0627-Jan-11 23:07
Civic0627-Jan-11 23:07 
GeneralRe: PDF Annotator Pin
Richard MacCutchan28-Jan-11 1:37
mveRichard MacCutchan28-Jan-11 1:37 
GeneralRe: PDF Annotator Pin
David Skelly28-Jan-11 2:09
David Skelly28-Jan-11 2:09 
QuestionChanging the CSS properties of a menu bar. Pin
Douglas Kirk24-Jan-11 20:42
Douglas Kirk24-Jan-11 20:42 
Hello,

I have a simple menu bar base on a ul li list with embedded hyperlinks.

<ul>
    <li id="menuHome"><a href="index.html" onMouseOver="setMenu('menuHome')" >Home</a></li>
    <li id="menuResults"><a href="results.htm">Results</a></li>
    <li id="menuEvents"><a href="events.htm">Events</a></li>
</ul>


I have set the CSS properties such as

#menuHome {
	background-color: #CCC;
	color: #000;
}


#navleft ul {
	list-style: none;
	padding: 0;
	margin: 0 0 5px 0 ;
	text-align: left;
}

#navleft li {
	margin: 5px 0;
	line-height: 23px;
}

#navleft li a {
	text-decoration: none;
	padding-left: 9px;
    display: block;
	width: 140px;
}


My Java script is quite basic

function setMenu( id )
{
    var e = document.getElementById(id);
    e.style.backgroundColor = 0x666666;
    e.style.color = 0xFFFFFF;

}


My goal is to basically have a vertical menu bar that can be used for multiple webpages, so that after the user clicks on it, it will change the background color and text to a different color, so that it is apparent which page the user is on.
(I realize that I'm using the mouse hover for testing, it stops the page from reloading every time I test it).


The problem that I am having, if my understanding is corrent is that the tag that I pass in the jave call is bond to the "li" element of the menu list, the background color changes quite fine, but, I can not seem to be able to access the color property of the "a href" tag to change the text from black to white.

using the e.style example above how would to "Cast it" to the a reference?

Thank you in advance.
AnswerRe: Changing the CSS properties of a menu bar. Pin
Richard MacCutchan24-Jan-11 21:25
mveRichard MacCutchan24-Jan-11 21:25 
GeneralRe: Changing the CSS properties of a menu bar. Pin
Douglas Kirk24-Jan-11 21:38
Douglas Kirk24-Jan-11 21:38 
Question.properties file added to database Pin
pancakeleh23-Jan-11 17:07
pancakeleh23-Jan-11 17:07 
AnswerRe: .properties file added to database Pin
David Skelly23-Jan-11 22:18
David Skelly23-Jan-11 22:18 
GeneralRe: .properties file added to database [modified] Pin
pancakeleh24-Jan-11 15:46
pancakeleh24-Jan-11 15:46 
GeneralRe: .properties file added to database Pin
Richard MacCutchan24-Jan-11 21:27
mveRichard MacCutchan24-Jan-11 21:27 
GeneralRe: .properties file added to database Pin
David Skelly24-Jan-11 22:18
David Skelly24-Jan-11 22:18 
GeneralRe: .properties file added to database Pin
pancakeleh24-Jan-11 22:42
pancakeleh24-Jan-11 22:42 
GeneralRe: .properties file added to database Pin
TorstenH.25-Jan-11 2:12
TorstenH.25-Jan-11 2:12 
GeneralRe: .properties file added to database Pin
Richard MacCutchan25-Jan-11 3:01
mveRichard MacCutchan25-Jan-11 3:01 
GeneralRe: .properties file added to database Pin
David Skelly25-Jan-11 3:41
David Skelly25-Jan-11 3:41 
GeneralRe: .properties file added to database Pin
pancakeleh25-Jan-11 16:18
pancakeleh25-Jan-11 16:18 
GeneralRe: .properties file added to database Pin
David Skelly25-Jan-11 22:27
David Skelly25-Jan-11 22:27 
GeneralRe: .properties file added to database [modified] Pin
pancakeleh26-Jan-11 15:15
pancakeleh26-Jan-11 15:15 
GeneralRe: .properties file added to database Pin
David Skelly26-Jan-11 22:23
David Skelly26-Jan-11 22:23 
GeneralRe: .properties file added to database Pin
Richard MacCutchan26-Jan-11 22:54
mveRichard MacCutchan26-Jan-11 22:54 
AnswerRe: .properties file added to database Pin
TorstenH.23-Jan-11 22:47
TorstenH.23-Jan-11 22:47 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.