Avatar of Chrism
Chrism
Flag 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
JavaScript

Avatar of undefined
Last Comment
Chrism

8/22/2022 - Mon
SOLUTION
nschafer

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
ASKER CERTIFIED SOLUTION
aaronchan

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
aaronchan

Agreed with nschafer, using images for buttons would work the same way.
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
nschafer

See this link for how to split points.

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

Neal
This is the best money I have ever spent. I cannot not tell you how many times these folks have saved my bacon. I learn so much from the contributors.
rwheeler23
Chrism

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

Chrism