|
Post by monokr0me on Mar 15, 2011 5:47:48 GMT
What I am trying to do here is make a navigation bar with several sections. When a section is hovered over, a menu will appear below with several links. This menu will stay open if the user mouses over the menu, but will close if the user mouses off both the section and the menu. I have made a .gif animation that will hopefully help clarify. I have the code below to open the menu, but I am unsure as how to: position the menu below the section, and to keep it open if the user mouses onto the menu, but clsoe it if they mouse onto anything else. function Hover(c) { switch(c) { case 0: //open menu for first section break; case 1: //open menu for second section break; } }
|
|
|
Post by Fringe Pioneer on Mar 15, 2011 6:27:58 GMT
I would imagine that, for positioning, you would want to use either relative or absolute, probably the latter since it's defined relative to the most immediate non-static parent element, and determine how far below you want the menu to appear. Within the menu, you probably want to create a vertical navigation bar.
I'm not sure what to do about the hovering. I had come up with a solution, but noticed a problem with hovering onto a child: you would have to hover off the parent to do so, and that passed a test in my code that would call for the closure of a child menu after it was opened by hovering onto the parent...
I do suggest getting help from Disabled, if he has the time or will to help. He helped me with a few simple things concerning the H/F...
|
|