') .parent().hide() .appendTo('body'); $('.footer-navigation').clone().attr('class', 'mobile-menu footer').appendTo(menu_wrapper); } else { menu_wrapper = $('.'+mts_customscript.nav_menu+'-navigation') .clone().attr('class', 'mobile-menu ' + mts_customscript.nav_menu) .wrap('
').parent().hide() .appendTo('body'); } $('.toggle-mobile-menu').click(function(e) { e.preventDefault(); e.stopPropagation(); $('#mobile-menu-wrapper').show(); $('body').toggleClass('mobile-menu-active'); }); $(document).on('DOMMouseScroll mousewheel', '#mobile-menu-wrapper', function(ev) { var $this = $(this), scrollTop = this.scrollTop, scrollHeight = this.scrollHeight, height = $this.height(), delta = (ev.type == 'DOMMouseScroll' ? ev.originalEvent.detail * -40 : ev.originalEvent.wheelDelta), up = delta > 0; var prevent = function() { ev.stopPropagation(); ev.preventDefault(); ev.returnValue = false; return false; } if (!up && -delta > scrollHeight - height - scrollTop) { $this.scrollTop(scrollHeight); return prevent(); } else if (up && delta > scrollTop) { $this.scrollTop(0); return prevent(); } }); }).click(function() { jQuery('body').removeClass('mobile-menu-active'); });$(function($) { $('#navigation ul.sub-menu, #navigation ul.children').hide(); $('#navigation li').hover( function() { $(this).children('ul.sub-menu, ul.children').slideDown('fast'); }, function() { $(this).children('ul.sub-menu, ul.children').hide(); } );}); }); } if (window.addEventListener) window.addEventListener("load", loadJQuery, false); else if (window.attachEvent) window.attachEvent("onload", loadJQuery); else window.onload = loadJQuery;