Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Hover delay when mouse move cross

I have a navigation menu and I want when mouse moves across, then navigation will be delayed 200 ms. How can I do that?

Example: http://www.amazon.com/

Amazon has left navigation (Shop by department) when the mouse moves across navigation waits.

<ul id="nav">
<li><a href="#">Menu 1</a>
    <ul>
        <li>Sub Menu 1</li>
        <li>Sub Menu 2</li>
    </ul>
</li>
<li><a href="#">Menu 2</a>
    <ul>
        <li>Sub Menu 3</li>
        <li>Sub Menu 4</li>
    </ul>
</li>
<li><a href="#">Menu 3</a></li>
<li><a href="#">Menu 4</a></li>
</ul>

For example; If mouse on "Menu 1" and cross move to "Sub Menu 1", "Menu 1" should not be closed. Else "Menu 1" should be close.

like image 706
mrchad Avatar asked Oct 22 '22 21:10

mrchad


1 Answers

http://cherne.net/brian/resources/jquery.hoverIntent.html is the script you are looking for.

Simply said, it will check whether you went by fast or slow with your mouse.

like image 109
easwee Avatar answered Oct 31 '22 14:10

easwee