w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
Select menu WITHIN a Nav menu.. issue of .mouseleave firing when user attempts to use a select menu within one of the submenus

How about preventing the mouseleave when the select gets the focus?

something like this maybe

$('.menu').mouseleave(function() {
    var selectFocused = $('select').is(":focus");

    if (!selectFocused) {
      // hide Menu if select doesnt have the focus
    }
});

But this would also prevent the menu from closing when you leave the menu while the select is focused.





© Copyright 2018 w3hello.com Publishing Limited. All rights reserved.