$=jQuery; $( document ).ready(function() { jQuery('.main-navigation').meanmenu({ meanMenuContainer: '.main-menu', meanScreenWidth:"767", meanMenuOpen: "", }); $('.owl-carousel').owlCarousel({ loop:true, margin:0, nav:true, dots:false, responsive:{ 0:{ items:1 }, 600:{ items:1 }, 1000:{ items:1 } } }) jQuery('.content-area, .widget-area').theiaStickySidebar({ // Settings additionalMarginTop: 30 }); /* back-to-top button*/ $('.back-to-top').hide(); $('.back-to-top').on("click",function(e) { e.preventDefault(); $('html, body').animate({ scrollTop: 0 }, 'slow'); }); $(window).scroll(function(){ var scrollheight =400; if( $(window).scrollTop() > scrollheight ) { $('.back-to-top').fadeIn(); } else { $('.back-to-top').fadeOut(); } }); //keyboard navigation for mean menu var menuFocus = { click: function(e) { if ( jQuery(this).hasClass('menu-item-has-children') ) { jQuery(this).find('.mean-expand').addClass('mean-clicked'); } jQuery(this).siblings('li').find('.mean-expand').removeClass('mean-clicked'); jQuery(this).children('.sub-menu').show().end().siblings('li').find('ul').hide(); }, keydown: function(e) { e.stopPropagation(); if (e.keyCode == 9) { if (!e.shiftKey && ( jQuery('.mean-bar li').index( jQuery(this) ) == ( jQuery('.mean-bar li').length-1 ) ) ){ jQuery('.meanclose').trigger('click'); } else if( jQuery('.mean-bar li').index( jQuery(this) ) == 0 ) { $('.meanclose').removeClass('onfocus'); } else if (e.shiftKey && jQuery('.mean-bar li').index(jQuery(this)) === 0) jQuery('.mean-bar ul:first > li:last').focus().blur(); } }, keyup: function(e) { e.stopPropagation(); if (e.keyCode == 9) { if (menuFocus.cancelKeyup) menuFocus.cancelKeyup = false; else menuFocus.click.apply(this, arguments); } } } jQuery(document) .on('click', 'li', menuFocus.click) .on('keydown', 'li', menuFocus.keydown) .on('keyup', 'li', menuFocus.keyup); jQuery('.mean-bar li').each(function(i) { this.tabIndex = i; }); });