Hello, there is a menu, when you direct one submenu appears, how to make it appear not at a tip but with a click, but when you click on an empty space, it just closes

if ($(window).width() > 1220) { $('.top-menu li:has(.hidden-menu)').hover(function() { $(this).find('.hidden-menu').fadeToggle(200); $(this).toggleClass('menuactive'); }); } else { $('.top-menu li:has(.hidden-menu) > a').click(function() { $(this).parent().find('.hidden-menu').fadeToggle(200); $(this).parent().toggleClass('menuactive'); return false; }); }; 

  • so and replace hover with click - Grundy
  • I replaced it, but it does not close when clicking on an empty space - Vitaly Nosikov
  • You can hang the event "click" on the "document" which will close your menu, provided that the click was not on the menu items. - grnch
  • Help please attach to this script - Vitaly Nosikov

0