1jQuery.noConflict(); 2(function ($) { 3 'use strict'; 4 5 $(document).ready(function () { 6 $('body').addClass('loaded'); 7 }); 8 9 $('.navbar .dropdown-toggle').hover(function () { 10 $(this).addClass('disabled'); 11 }); 12 13 $(window).scroll(function () { 14 var $unstick = $('body.unstick-menu'); 15 if (!$unstick.length) { 16 var topmenu = $('#top-navigation').outerHeight(); 17 var header = $('.site-header').outerHeight(); 18 if ($(document).scrollTop() > (topmenu + header + 50)) { 19 $('nav#site-navigation').addClass('shrink'); 20 } else { 21 $('nav#site-navigation').removeClass('shrink'); 22 } 23 } 24 }); 25 26 var $myDiv = $('#futurio-floating'); 27 if ($myDiv.length) { 28 $(window).scroll(function () { 29 var distanceTop = $myDiv.prev().position().top + $myDiv.prev().height() + 80; 30 31 if ($(document).scrollTop() > distanceTop) { 32 $myDiv.addClass('floating-element'); 33 } else { 34 $myDiv.removeClass('floating-element'); 35 } 36 }); 37 } 38 39 // Menu fixes 40 function MenuFix() { 41 $(function () { 42 if ($(window).width() > 767) { 43 $('.dropdown, .dropdown-submenu').hover( 44 function () { 45 $(this).addClass('open') 46 }, 47 function () { 48 $(this).removeClass('open') 49 } 50 ); 51 $('.dropdown, .dropdown-submenu').focusin( 52 function () { 53 $(this).addClass('open') 54 } 55 ); 56 $('.dropdown, .dropdown-submenu').focusout( 57 function () { 58 $(this).removeClass('open') 59 } 60 ); 61 } else { 62 $(".dropdown, .dropdown-submenu").hover( 63 function () { 64 $(this).removeClass('open') 65 } 66 ); 67 } 68 }); 69 } 70 MenuFix(); 71 $(window).on('resize', MenuFix); 72 73 // Mobile menu function 74 function FuturioMobileMenu() { 75 $('.open-panel').each(function () { 76 var menu = $(this).data('panel'); 77 $("#" + menu).click(function (e) { 78 e.preventDefault(); 79 $("#blog").toggleClass("openNav"); 80 $("#" + menu + ".open-panel").toggleClass("open"); 81 }); 82 $("#site-navigation .menu-container a").click(function () { 83 $("#blog").toggleClass("openNav"); 84 $("#" + menu + ".open-panel").toggleClass("open"); 85 }); 86 87 }); 88 } 89 var $openPanel = $('.open-panel'); 90 if ($openPanel.length) { 91 // Fire mobile menu 92 FuturioMobileMenu(); 93 94 } 95 96 $('.top-search-icon .fa').click(function () { 97 $(".top-search-box").toggle('slow'); 98 $(".top-search-icon .fa").toggleClass("fa-times fa-search"); 99 }); 100 101 $('.offcanvas-sidebar-toggle').on('click', function () { 102 $('body').toggleClass('offcanvas-sidebar-expanded'); 103 }); 104 $('.offcanvas-sidebar-close').on('click', function () { 105 $('body').toggleClass('offcanvas-sidebar-expanded'); 106 }); 107 108 var sections = $('section') 109 , nav = $('#site-navigation.navbar') 110 , nav_height = nav.outerHeight(); 111 112 $(window).on('scroll', function () { 113 var cur_pos = $(this).scrollTop(); 114 115 sections.each(function () { 116 var top = $(this).offset().top - nav_height - 30, 117 bottom = top + $(this).outerHeight(); 118 119 if (cur_pos >= top && cur_pos <= bottom) { 120 nav.find('a').parent().removeClass('active'); 121 sections.removeClass('active'); 122 123 $(this).addClass('active'); 124 nav.find('a[href="#' + $(this).attr('id') + '"]').parent().addClass('active'); 125 } 126 }); 127 }); 128 129 $(document).on('click', '.button.ajax_add_to_cart', function (e) { 130 //e.preventDefault(); 131 $('body.open-head-cart').addClass('product-added-to-cart'); 132 }); 133 $(document).on('mouseover', '.product-added-to-cart ul.site-header-cart', function (e) { 134 e.preventDefault(); 135 $('body.open-head-cart').removeClass('product-added-to-cart'); 136 }); 137})(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.