1(function( $ ) { 2 "use strict"; 3/*----------------------------------------------------------------------*/ 4/* = Menu Smooth scrolling 5/*----------------------------------------------------------------------*/ 6 var scrollLink = $('ul.pr-main-menu li a, .page-template-template-one-page-builder .pr__mobile__nav .menu .ul-menu > li >a'); 7 8 // Smooth scrolling 9 scrollLink.click(function() { 10 if (!$(this).parent().hasClass('menu-item-has-children')) 11 { 12 $('body,html').animate({ 13 scrollTop: $(this.hash).offset().top-68 14 }, 800, 'easeInExpo' ); 15 } 16 }); 17/*----------------------------------------------------------------------*/ 18/* = Mobile Menu Toggle 19/*----------------------------------------------------------------------*/ 20 21 $('<div class="mobile-navigation-overlay"></div>').insertBefore('.mobile-navigation'); 22 $('.nav-toggle, .close-tigger, .mobile-navigation-overlay').on('click', function() { 23 $('body, .mobile-navigation, .mobile-navigation-inner, .mobile-navigation-overlay').toggleClass('mobile-menu-opened'); 24 }); 25 26/*----------------------------------------------------------------------*/ 27/* = Mobile Menu List 28/*----------------------------------------------------------------------*/ 29 30 $(".pr__mobile__nav .ul-menu ul").slideUp(600); 31 32 $(".pr__mobile__nav .ul-menu > li.menu-item-has-children > a").on("click", function (e) { 33 $(".pr__mobile__nav .ul-menu ul").slideUp(600); 34 if (!$(this).next().is(":visible")) { 35 $(this).next().slideDown(600); 36 } 37 e.preventDefault(); 38 }); 39 $(".pr__mobile__nav .ul-menu > li.menu-item-has-children > ul > li.menu-item-has-children > a").on("click", function (e) { 40 $(".pr__mobile__nav .ul-menu ul ul").slideUp(600); 41 if (!$(this).next().is(":visible")) { 42 $(this).next().slideDown(600); 43 } 44 e.preventDefault(); 45 }); 46 47/*----------------------------------------------------------------------*/ 48/* = Add parent class If submenu goes outside 49/*----------------------------------------------------------------------*/ 50function menus_dropdown_conditionally_open() { 51 $(".primary-navigation .sub-menu .menu-item.menu-item-has-children").each(function(){ 52 if($(this).children('ul').length == 1) { 53 var parent = $(this); 54 var child_menu = $(this).children('ul'); 55 if( $(parent).offset().left + $(parent).width() + $(child_menu).width() > $(window).width() ){ 56 $(child_menu).addClass('pixe-left-align-sub-menu'); 57 } 58 } 59 }); 60 }; 61 menus_dropdown_conditionally_open(); 62 63/*----------------------------------------------------------------------*/ 64/* = Sticky Header Initialisation 65/*----------------------------------------------------------------------*/ 66var sticky_nav = $('.pixe_sticky_header_holder .pr-primary-navigation > nav > ul.pr-main-menu'); 67 68var sticky = $('.pixe_sticky_header_holder'); 69UIkit.util.on(sticky, 'active', function () { 70 sticky.addClass('show_sticky'); 71 UIkit.scrollspyNav(sticky_nav, { 72 "offset": 0, 73 "closest": 'li', 74 "scroll": true, 75 }); 76 77}); 78 79UIkit.util.on(sticky, 'inactive', function () { 80 sticky.removeClass("show_sticky"); 81 UIkit.scrollspyNav(sticky_nav).$destroy(); 82}); 83 84var off_canvas = $('#navbar-mobile'); 85 86UIkit.util.on(off_canvas, 'shown', function () { 87 off_canvas.addClass('offcanvas_anime') 88}); 89UIkit.util.on(off_canvas, 'hidden', function () { 90 off_canvas.removeClass('offcanvas_anime') 91}); 92 93})(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.