Is there a way to make the dropdown menu hide automatically after the mouse cursor leaves the area?
If you take a look at Amazon.com for example, when you hover over "Shop by Department" and then quickly move your cursor away and back within about half a second, the dropdown menu stays visible.
Check out this Bootstrap Snippet:
I thought about using a setTimeout
, but that might hide the dropdown even if I bring my cursor back within those few seconds. Maybe clearing the setTimeout
on mouseOver could solve this issue?
How do people typically handle this situation?