Problem in writing a text menu responding to onclick event 
Author Message
 Problem in writing a text menu responding to onclick event
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" ;

Quote:
}

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



Sat, 04 Oct 2003 12:51:08 GMT  
 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
|
|


Sat, 04 Oct 2003 18:48:02 GMT  
 Problem in writing a text menu responding to onclick event
To Walter Zackery,

Many Thanks for the help.

NP



Quote:
> 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";
> }



> | 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
> |
> |



Sun, 05 Oct 2003 05:59:03 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Popup menus - responding to events

2. problem with onClick event for radio button

3. Onclick event for Java applet with VBScript problem...

4. Onclick event in NN4 , HourGlass problem

5. fire keyboard events form an onclick page event

6. Respond to embedded WMP Events?

7. Responding to Events in VB Script

8. Responding to event in a browser

9. <object> and responding to events

10. Frames: Responding to an event after a frame loads

11. Responding to Events

12. Dynamically-added elements don't respond to events

 

 
Powered by phpBB® Forum Software