I have a Nav that has a drop down sub menu. When the drop down appears i would like a union of menu + drop down like this:

so that if the mouse exits this entire block in pink, then the sub nav disappears. Currently, if the mouse exits only the drop down, the dropdown is gone.
I saw this example but combining the class together did not work for me.
Here’s MY FIDDLE
Why don’t just remove the subClass from targets of both
mouseenterANDmouseleave? Like this:… as
.myClasscovered area IS already a union of menu and drop (as the corresponding element includes both link and dropdown menu).I’ve fixed another potential bug here: it’s possible to sequence mouseleave-mouseenter events too fast, then timeout function will fire even though it shouldn’t (as the cursor stays in the menu area). To prevent this, an additional variable (
animate) has been added; it stored the timeout in themouseleavehandler and clears it in the `mouseenter’ one.