1jQuery(document).ready(function($) { 2 3 $('.mob-menu-btn').on('click', function(e) { 4 e.preventDefault(); 5 $('.main-nav').toggleClass('open'); 6 }); 7 8 $('.main-nav li.has-child>a').on('click',function(e) { 9 if ($('.mob-menu-btn').is(':visible')) { 10 e.preventDefault(); 11 var submenu = $(this).parent().children('ul'); 12 if (submenu.hasClass('open')) { 13 submenu.removeClass('open'); 14 } else { 15 $('.main-nav ul.open').each(function() { 16 if ($(this).find(submenu).length == 0) { 17 $(this).removeClass('open'); 18 } 19 }); 20 submenu.addClass('open'); 21 } 22 } 23 }); 24 25 //click outside 26 $(document).click(function(event) { 27 if ($(event.target).closest('.mob-menu-btn').length==0) { 28 if (!$(event.target).closest('.main-nav').length) { 29 $('.main-nav, .main-nav ul').removeClass("open"); 30 } 31 } 32 }); 33 34})
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.