I think, you are talking about a simple layer-based navigation menu. As long as your mouse is over the link that shows the menu, the menu will be visible. The idea behind using setTimeout() is to make the menu visible for some time before it hides onMouseout.
The general idea behind that is this: a mouseout event will always be fired first when the mouse leaves a menu element; then, assuming you've moved to another element (still over the menu, i.e.) a mouseover will fire on the new element. Obviously, you need to reverse the order of these events if you want to use the over (still over the menu) to cancel the result of an out (hiding the menu). A timer delay does this, giving you a sufficient period to clearTimeout() and cancel the mouseout action. It also can allow for user navigation between non-contiguous (separated) menu panels. Generally it can help to avoid hyper-active, 'flickering' menu systems.
Comment