1(function ($) { 2 "use strict"; 3 4 // Sticky nav menu 5 $(window).scroll(function () { 6 var viewPortWidth = $(window).width(); 7 var scrollTop = $(window).scrollTop(); 8 9 if (viewPortWidth <= 767) { 10 if (scrollTop >= 80) { 11 $("body").addClass("sticky-header"); 12 $("header .navbar").addClass("navbar-sticky"); 13 } else { 14 $("body").removeClass("sticky-header"); 15 $("header .navbar").removeClass("navbar-sticky"); 16 } 17 } else { 18 if (scrollTop >= 130) { 19 $("body").addClass("sticky-header"); 20 $("header .navbar").addClass("navbar-sticky"); 21 } else { 22 $("body").removeClass("sticky-header"); 23 $("header .navbar").removeClass("navbar-sticky"); 24 } 25 } 26}); 27 28 jQuery( function($) { 29 $('.js-carousel').slick(); 30 31 32 $('.woocommerce').on('click', 'span.minus', function(){ 33 $('.woocommerce-input-error.hidden').fadeOut(); 34 var $input = $(this).parent().find('input'); 35 var count = parseInt($input.val()) - 1; 36 count = count < 1 ? 1 : count; 37 $input.val(count); 38 $input.change(); 39 return false; 40 }); 41 $('.woocommerce').on('click', 'span.plus', function(){ 42 var $input = $(this).parent().find('input'); 43 var max = parseInt($input.attr('max')); 44 var newVal = parseInt($input.val()) + 1; 45 if(max >= newVal) { 46 $input.val(parseInt($input.val()) + 1); 47 $input.change(); 48 } else { 49 $('.woocommerce-input-error.hidden').fadeIn(); 50 } 51 return false; 52 }); 53 }); 54 55 // For making the button sticky. 56 var buttonToSticky = document.getElementById("single-add-to-cart"); 57 if (buttonToSticky) { 58 window.onscroll = function () { stickButtonOnBottom() }; 59 var sticky = buttonToSticky.offsetTop - 800; 60 } 61 62 function stickButtonOnBottom() { 63 if (window.pageYOffset >= sticky) { 64 buttonToSticky.classList.add("btn-sticky") 65 } else { 66 buttonToSticky.classList.remove("btn-sticky"); 67 } 68 } 69})(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.