Link to home
Create AccountLog in
Avatar of Chrism
ChrismFlag for Australia

asked on

A simple challenge - mouseout, mouseover, mousedown

Hi,

I getting a webpage developed and I am being told that the following is not possible.  I don't believe them.  So...I am after a sample bit of code that will do the following:

The page that is currently working has:

- 3 buttons to navigate
- The buttons are graphics
- When the mouse is passed over the buttons, the buttons 'light up' with an alternate graphic
- When the mouse is clicked, the iframe is changed to the target of the button, and the parent frame (with the nav) is not refreshed

This is great.  What I want to happen though is for the button to remain 'lit up' once the button has been clicked.  Then, as you pass the mouse over the nav. buttons, the 'active' one stays lit and the other are only lit when the mouse is over them.

Once the user clicks on a second button, then it is the only one that stays on.  The previously 'lit' button, then goes back to the standard mouseover action.

Does this make sense?

I don't know javascript, but to my layman's way of thinking, when the button is clicked, you just turn off the mouseout event for that button, check the other buttons and turn off any that are one, while re-enabling the mouseout event for them.

Either that or just set a button[n]_clicked flag, and for every mouseout, check the flag status before changing the button image.

Looking forward to your responses.

Thanks,
Chris
SOLUTION
Avatar of nschafer
nschafer
Flag of United States of America image

Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
ASKER CERTIFIED SOLUTION
Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
Avatar of aaronchan
aaronchan

Agreed with nschafer, using images for buttons would work the same way.
Avatar of Chrism

ASKER

Hi Guys,

Thanks very much.  I like to split the point - nschafer, nice example, but aaronchan's is perfect.

I'd like to give you each an A split 100/200

Do you still have to get a moderator to help with this?

Chrism
See this link for how to split points.

https://www.experts-exchange.com/help.jsp#hi69

Neal
Avatar of Chrism

ASKER

Thanks Neal - on looking the second time it was right in front of me...

Chrism