
Problem in writing a text menu responding to onclick event
function highlight()
{
if(highlight.oObj && highlight.oObj ==
window.event.srcElement) return;
if(highlight.oObj)
highlight.oObj.style.color = highlight.oObj.currentColor;
highlight.oObj = window.event.srcElement;
highlight.oObj.currentColor = highlight.oObj.style.color;
highlight.oObj.style.color = "#FF0000";
Quote:
}
| My site design consists of top frame and main(bottom) frame. I am
trying to
| create a navigation menu made of hyperlink texts in the top frame.
When the
| user clicks on a link, the font-color of the text is switched to red.
I got
| this done using below code.
|
| function highlight()
| {
| var oObj = event.srcElement
| oObj.style.color = "#FF0000" ;
| }
|
| But my real problem is getting following behaviour.
|
| when the user clicks onto another link, the changes applied to the
previous
| clicked link have to be undone and the font of the last clicked link
is to
| be switched.
|
| I want the code to work in atleast IE 4.0 browsers. For some reason I
do
| not want to use images as hyperlink. Help me with any idea, examples
or
| links on how to write this?
|
| Thanks in advance ...
|
| NP
|
|