1(function ($) { 2 "use strict"; 3 4 // Accrodion 5 if ($(".accrodion-grp").length) { 6 var accrodionGrp = $(".accrodion-grp"); 7 accrodionGrp.each(function () { 8 var accrodionName = $(this).data("grp-name"); 9 var Self = $(this); 10 var accordion = Self.find(".accrodion"); 11 Self.addClass(accrodionName); 12 Self.find(".accrodion .accrodion-content").hide(); 13 Self.find(".accrodion.active").find(".accrodion-content").show(); 14 accordion.each(function () { 15 $(this) 16 .find(".accrodion-title") 17 .on("click", function () { 18 if ($(this).parent().hasClass("active") === false) { 19 $(".accrodion-grp." + accrodionName) 20 .find(".accrodion") 21 .removeClass("active"); 22 $(".accrodion-grp." + accrodionName) 23 .find(".accrodion") 24 .find(".accrodion-content") 25 .slideUp(); 26 $(this).parent().addClass("active"); 27 $(this) 28 .parent() 29 .find(".accrodion-content") 30 .slideDown(); 31 } 32 }); 33 }); 34 }); 35 } 36 37 38 if ($(".scroll-to-target").length) { 39 $(".scroll-to-target").on("click", function () { 40 var target = $(this).attr("data-target"); 41 // animate 42 $("html, body").animate({ 43 scrollTop: $(target).offset().top, 44 }, 45 1000 46 ); 47 48 return false; 49 }); 50 } 51 52 53 if ($(".video-popup").length) { 54 $(".video-popup").magnificPopup({ 55 type: "iframe", 56 mainClass: "mfp-fade", 57 removalDelay: 160, 58 preloader: true, 59 60 fixedContentPos: false, 61 }); 62 } 63 64 if ($(".img-popup").length) { 65 var groups = {}; 66 $(".img-popup").each(function () { 67 var id = parseInt($(this).attr("data-group"), 10); 68 69 if (!groups[id]) { 70 groups[id] = []; 71 } 72 73 groups[id].push(this); 74 }); 75 76 $.each(groups, function () { 77 $(this).magnificPopup({ 78 type: "image", 79 closeOnContentClick: true, 80 closeBtnInside: false, 81 gallery: { 82 enabled: true, 83 }, 84 }); 85 }); 86 } 87 88 if ($(".add").length) { 89 $(document).on("click", '.add', function () { 90 if ($(this).prev().val() < 999) { 91 $(this) 92 .prev() 93 .val(+$(this).prev().val() + 1); 94 } 95 $(this).prev().trigger('change'); 96 }); 97 } 98 99 if ($(".sub").length) { 100 $(document).on("click", '.sub', function () { 101 if ($(this).next().val() > 1) { 102 if ($(this).next().val() > 1) 103 $(this) 104 .next() 105 .val(+$(this).next().val() - 1); 106 } 107 $(this).next().trigger('change'); 108 }); 109 } 110 111 112 if ($(".main-menu__list").length && $(".mobile-nav__container").length) { 113 let navContent = document.querySelector(".main-menu__list").outerHTML; 114 let mobileNavContainer = document.querySelector(".mobile-nav__container"); 115 mobileNavContainer.innerHTML = navContent; 116 } 117 if ($(".sticky-header__content").length) { 118 let navContent = document.querySelector(".main-menu").innerHTML; 119 let mobileNavContainer = document.querySelector(".sticky-header__content"); 120 mobileNavContainer.innerHTML = navContent; 121 } 122 123 if ($(".mobile-nav__container .main-menu__list").length) { 124 let dropdownAnchor = $( 125 ".mobile-nav__container .main-menu__list .menu-item-has-children > a" 126 ); 127 dropdownAnchor.each(function () { 128 let self = $(this); 129 let toggleBtn = document.createElement("BUTTON"); 130 toggleBtn.setAttribute("aria-label", "dropdown toggler"); 131 toggleBtn.innerHTML = "<i class='fa fa-angle-down'></i>"; 132 self.append(function () { 133 return toggleBtn; 134 }); 135 self.find("button").on("click", function (e) { 136 e.preventDefault(); 137 let self = $(this); 138 self.toggleClass("expanded"); 139 self.parent().toggleClass("expanded"); 140 self.parent().parent().children("ul").slideToggle(); 141 }); 142 });
143 } 144 145 if ($(".mobile-nav__toggler").length) { 146 $(".mobile-nav__toggler").on("click", function (e) { 147 e.preventDefault(); 148 $(".mobile-nav__wrapper").toggleClass("expanded"); 149 $("body").toggleClass("locked"); 150 }); 151 } 152 153 if ($(".search-toggler").length) { 154 $(".search-toggler").on("click", function (e) { 155 e.preventDefault(); 156 $(".search-popup").toggleClass("active"); 157 $(".mobile-nav__wrapper").removeClass("expanded"); 158 $("body").toggleClass("locked"); 159 }); 160 } 161 162 163 if ($(".dynamic-year").length) { 164 let date = new Date(); 165 $(".dynamic-year").html(date.getFullYear()); 166 } 167 168 if ($(".wow").length) { 169 var wow = new WOW({ 170 boxClass: "wow", // animated element css class (default is wow) 171 animateClass: "animated", // animation css class (default is animated) 172 mobile: true, // trigger animations on mobile devices (default is true) 173 live: true, // act on asynchronously loaded content (default is true) 174 }); 175 wow.init(); 176 } 177 178 179 // window load event 180 181 $(window).on("load", function () { 182 if ($(".preloader").length) { 183 $(".preloader").fadeOut(); 184 } 185 186 }); 187 188 // window scroll event 189 190 $(window).on("scroll", function () { 191 if ($(".stricked-menu").length) { 192 var headerScrollPos = 130; 193 var stricky = $(".stricked-menu"); 194 if ($(window).scrollTop() > headerScrollPos) { 195 stricky.addClass("stricky-fixed"); 196 } else if ($(this).scrollTop() <= headerScrollPos) { 197 stricky.removeClass("stricky-fixed"); 198 } 199 } 200 if ($(".scroll-to-top").length) { 201 var strickyScrollPos = 100; 202 if ($(window).scrollTop() > strickyScrollPos) { 203 $(".scroll-to-top").fadeIn(500); 204 } else if ($(this).scrollTop() <= strickyScrollPos) { 205 $(".scroll-to-top").fadeOut(500); 206 } 207 } 208 }); 209 210 211 $(document).on('click', '.shop-one__cart.agriox_ajax ', function (e) { 212 $(".agriox-overlay").fadeIn(300); 213 }); 214 215 $(document.body).on('added_to_cart', function (event, fragments, cart_hash, $button) { 216 $(".agriox-overlay").fadeOut(300); 217 218 }); 219 220})(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.