Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Rollovers and onClick event

Status
Not open for further replies.

celley

Programmer
Jul 31, 2000
54
0
0
A2
I need a script that will allow me to do rollovers, but with an onClick event, it keeps the rollover on.

I have the navigation bar (where I want the rollovers to occur) inside a frame and this is where the problem occurs. I have it working right now, but since the frame does not reload with an onClick event, I eventually have all of the links "rolled over".

Any ideas on how to accomplish this task? [sig]<p>Chad Elley<br><a href=mailto:celley@gobcg.com>celley@gobcg.com</a><br>[/sig]
 
May have missed the full point of your question, BUT how about amending your onMouseOver function(s) so that by default all other navigation images are set to the 'off' state, excepting the one being 'moused over' which is set 'on'. [sig][/sig]
 
I have all images set in the &quot;off&quot; state and onMouseOver, I am setting it to the &quot;on&quot; state. But when the onClick event occurs, I want the image to stay &quot;on&quot;. [sig]<p>Chad Elley<br><a href=mailto:celley@gobcg.com>celley@gobcg.com</a><br>[/sig]
 
I feared that I had got the question wrong - sorry!

Is it the case that you simply need to disable the onMouseOut event after an onClick has been actioned?

To achieve this:-
At the top declare boolean variables for each button:-
name1On = false;
name2On = false;
etc.

In the onClick handler:-
name1On = true;

In the onMouseOut handler (pseudo-code!):-
if name1On {do nothing}
else {set img 'off' and reset name1On to false}

Does this solve your problem? [sig][/sig]
 
I understand the logic behind the code... I just cant get it to work. I tried simplifying the question for you.. but the truth is that I am dynamically building the navigation bar through Cold Fusion. So it is a little more complex. On top of it all, the navigation is an expandible &quot;tree&quot;. If you know of nay code that I can look at, let me know.

Thanks [sig]<p>Chad Elley<br><a href=mailto:celley@gobcg.com>celley@gobcg.com</a><br>[/sig]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top