I’ve created a navigation bar with two drop-down menus. There was an issue with the height of the navigation bar overlapping content underneath, making it inaccessible. I therefore made the height of the div 70px, and then the mouseover runs a JS that makes the height 600px and back to 70px on mouse-out.
This works fine on computers, but on tablets there is no delay between the two menus - when you switch from one menu to another, the closing menu ends up making he height 70px when it should remain 600px.
Here is a video to show you what happens.
A possible solution I tried and failed with was a counter:
Counter starts at 0, mouse-over -> counter++.
Mouse out -> counter–
the JS to decrease size only runs if count == 0.
So therefore until both menu’s have closed, the counter will not be 0.
For some reason this doesn’t work though. I’ve included an original document from the video, and the one testing my potential solution.
Any help would be appreciated.
Original:
NAV.hype.zip (88.6 KB)
Solution attempt:
NAV - HELP.hype.zip (102.6 KB)
It needs to be on mouse over to accommodate desktop users. I think its more of a timeline issue, here is whats currently happening:
When mouse over one drop down on its OWN.
Mouse over -
- Click first drown down (start timeline A1 - open dropdown 1)
- Document height set to 600. (increase)
- Drop down appears (2 seconds)
Mouse out - (PLAY TIMELINE IN REVERSE)
(Start timeline A2 - close dropdown 1)
- Drop down disappears (2 seconds wait until 2. occurs)
- Document height set to 60. (decrease)
What happens on IPADS (clicking between the menus - no wait time before each timeline is finished)
- Dropdown 1 tap (Start timeline A1 - open dropdown 1)
- Document height set to 600. (increase)
- Dropdown 1 appears (wait 2 seconds timeline A1)
4.1 Dropdown 2 mouseover/tap (Start timeline B1 - Open dropdown 2)
4.2 Dropdown 1 Mouseout activated (Timeline A2 - close dropdown 1)
4.3 Timeline B1 : Document height set to 600. (increase)
4.4 Timeline B1 : Dropdown 2 appears (2 seconds)
4.5 Timeline A2 : Drop down disappears (2 seconds wait until 4.6 occurs)
4.6 Timeline A2 : Document height set to 60. (decrease)
Therefore…
Since timeline A2 and B1 will start at the same time -
B1 immediately increases height, then opens dropdown 2
A2 first has to close dropdown - takes 2 seconds.
A2 Makes document size 60 - PROBLEM.
If you swapped between the two on a desktop quick enough, the same problem would occur.
What I tried to do in my solution was check to see if another dropdown was opening, and therefore not make the document height decrease.
Another solution:
Can you force a timeline to wait until another one is finished?