1(function($) { 2 $.fn.menumaker = function(options) { 3 var mobile_menu = $(this), settings = $.extend({ 4 format: "dropdown", 5 sticky: false 6 }, options); 7 return this.each(function() { 8 mobile_menu.find('li ul').parent().addClass('has-sub'); 9 var multiTg = function() { 10 mobile_menu.find(".has-sub").prepend('<span class="submenu-button"></span>'); 11 mobile_menu.find(".hash").parent().addClass('hash-has-sub'); 12 mobile_menu.find('.submenu-button').on('click', function() { 13 $(this).toggleClass('submenu-opened'); 14 if ($(this).siblings('ul').hasClass('open-sub')) { 15 $(this).siblings('ul').removeClass('open-sub').hide('fadeToggle'); 16 $(this).siblings('ul').hide('fadeToggle'); 17 } 18 else { 19 $(this).siblings('ul').addClass('open-sub').hide('fadeToggle'); 20 $(this).siblings('ul').slideToggle().show('fadeToggle'); 21 } 22 }); 23 }; 24 if (settings.format === 'multitoggle') multiTg(); 25 else mobile_menu.addClass('dropdown'); 26 if (settings.sticky === true) mobile_menu.css('position', 'fixed'); 27 var resizeFix = function() { 28 if ($( window ).width() > 991) { 29 mobile_menu.find('ul').show('fadeToggle'); 30 mobile_menu.find('ul.sub-menu').hide('fadeToggle'); 31 } 32 }; 33 resizeFix(); 34 return $(window).on('resize', resizeFix); 35 }); 36 }; 37})(jQuery); 38 39(function($){ 40$(document).ready(function(){ 41 42$("#mobile_menu").menumaker({ 43 format: "multitoggle" 44}); 45 46}); 47})(jQuery);
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.