Click here to Skip to main content
15,891,136 members
Home / Discussions / JavaScript
   

JavaScript

 
QuestionPageMethods in Jquery Pin
Vimalsoft(Pty) Ltd25-Jan-11 3:11
professionalVimalsoft(Pty) Ltd25-Jan-11 3:11 
AnswerRe: PageMethods in Jquery Pin
Not Active25-Jan-11 3:57
mentorNot Active25-Jan-11 3:57 
GeneralRe: PageMethods in Jquery Pin
Vimalsoft(Pty) Ltd25-Jan-11 20:33
professionalVimalsoft(Pty) Ltd25-Jan-11 20:33 
Questionhow to enable/disable multiselection of table cells Pin
asbasir24-Jan-11 22:36
asbasir24-Jan-11 22:36 
Questionopener.document Pin
fififlowertot24-Jan-11 22:06
fififlowertot24-Jan-11 22:06 
AnswerRe: opener.document Pin
Richard MacCutchan25-Jan-11 3:03
mveRichard MacCutchan25-Jan-11 3:03 
AnswerRe: opener.document Pin
GenJerDan25-Jan-11 3:10
GenJerDan25-Jan-11 3:10 
QuestionChanging the CSS properties of a menu bar. Pin
Douglas Kirk24-Jan-11 20:56
Douglas Kirk24-Jan-11 20:56 
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.
Questionvar abc = abc || {}; in Java Script Pin
Umair Feroze18-Jan-11 0:27
Umair Feroze18-Jan-11 0:27 
AnswerRe: var abc = abc || {}; in Java Script Pin
Umair Feroze19-Jan-11 3:12
Umair Feroze19-Jan-11 3:12 
GeneralRe: var abc = abc || {}; in Java Script Pin
jsc4219-Jan-11 5:53
professionaljsc4219-Jan-11 5:53 
GeneralRe: var abc = abc || {}; in Java Script Pin
Not Active19-Jan-11 7:09
mentorNot Active19-Jan-11 7:09 
GeneralRe: var abc = abc || {}; in Java Script Pin
jsc4220-Jan-11 3:30
professionaljsc4220-Jan-11 3:30 
GeneralRe: var abc = abc || {}; in Java Script Pin
Not Active20-Jan-11 3:49
mentorNot Active20-Jan-11 3:49 
QuestionGet JSON Array [modified] Pin
dataminers17-Jan-11 12:04
dataminers17-Jan-11 12:04 
Questionzoom in and zoom out for entire page in all browser Pin
niladri0310-Jan-11 1:56
niladri0310-Jan-11 1:56 
AnswerRe: zoom in and zoom out for entire page in all browser Pin
J4amieC10-Jan-11 2:42
J4amieC10-Jan-11 2:42 
AnswerRe: zoom in and zoom out for entire page in all browser Pin
Not Active10-Jan-11 2:49
mentorNot Active10-Jan-11 2:49 
GeneralRe: zoom in and zoom out for entire page in all browser Pin
Ed Nutting14-Jan-11 9:03
Ed Nutting14-Jan-11 9:03 
GeneralRe: zoom in and zoom out for entire page in all browser Pin
Not Active14-Jan-11 9:23
mentorNot Active14-Jan-11 9:23 
GeneralRe: zoom in and zoom out for entire page in all browser Pin
Ed Nutting14-Jan-11 9:34
Ed Nutting14-Jan-11 9:34 
GeneralRe: zoom in and zoom out for entire page in all browser Pin
Not Active14-Jan-11 9:48
mentorNot Active14-Jan-11 9:48 
GeneralRe: zoom in and zoom out for entire page in all browser Pin
Ed Nutting14-Jan-11 9:57
Ed Nutting14-Jan-11 9:57 
Questionhow to gridivew in-place edit with jquery Pin
Tridip Bhattacharjee9-Jan-11 23:58
professionalTridip Bhattacharjee9-Jan-11 23:58 
AnswerRe: how to gridivew in-place edit with jquery Pin
Not Active10-Jan-11 2:46
mentorNot Active10-Jan-11 2:46 

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.