Click to See Complete Forum and Search --> : Menu disappearing issue
civic3x98
12-29-2003, 11:54 AM
I have a menu that drops down a series of buttons. I place my cursor over a part the image and the buttons drop down.
My problem is, when i take my cursor off the button to click on one of the dropped down buttons, the entire button goes back to its original state (no dropped down buttons).
How do i make the button not go back to its original state?
Thanks and happy holidays
Nigel McFarlane
12-29-2003, 07:59 PM
Some observations:
rather than rely on focus and hover behaviour entirely you can use two state variables (flags). Set one for hovering over the image, set the other for hovering over the dropdown. When the user moves over the dropdown, clear the dropdown flag. Only remove the dropdown if the dropdown flag is clear. If the user leaves the image without using the dropdown, set a timer. In the timer clear the dropdown flag and remove the dropdown in say 2 secs.
There are many other variations on this approach, too - this is just one.
civic3x98
12-31-2003, 12:02 PM
Ok, I have the menu 90% working. It contracts and retracts.
When the cursor moves over the original image (before the menu buttons come out). the sub menu buttons pop out.
But when I place the cursor over the sub menu buttons the menu retracts back to the original stage.
I was trying to put a clear button behind the sub buttons to keep the sub buttons remaining (instead of retracting). The problem with this.. due to there being the original button (with the same script action as the clear button), I guess the browser gets confused and doesnt consider the original button and the clear button to be the same, instead two diff commands that conflict.
How do I make the sub menu buttons stay?
Nigel McFarlane
12-31-2003, 05:21 PM
Not sure exactly how you're set up, but the main thing you need to do is detect which mouseover/mouseout/focus/blur events are changing the display state.
Write down a little table covering each tag x event x state flags and work out what state change should occur when each event occurs.
The problem must be getting the right combination of event handlers.
devx.com
Copyright Internet.com Inc. All Rights Reserved