PageSourceSearch

https://www.kailashherbs.co.nz/_scripts.js?ver=1790482286110

js kailashherbs.co.nz collected 2026-09-27 10:26:57 UTC 4,512 bytes, 141 lines download raw bytes

1/*USED BY TEMPLATE--------*/
2$(document).ready(function() {
3  // Add titles to featured products main column.
4 $('#sidebarcontent #FeaturedProductsFeatured li').addClass('featured')
5 $('#sidebarcontent #FeaturedProductsOnSale li').addClass('onsale').prepend('<div class="promoicon">Sale</div>');
6 $('#sidebarcontent #FeaturedProductsBestSeller li').addClass('bestseller').prepend('<div class="promoicon">Hot</div>');
7 $('#sidebarcontent #FeaturedProductsNewItems li').addClass('new').prepend('<div class="promoicon">New</div>');
8
9//ADD SALE PRICE TO DISCOUNTED ITEMS ONLY IF NON MEMBER...
10if( $("#memberSecurityBlock").length == 0){
11$(".ProductList .price.preDiscount").closest(".Product").find(".productlisttdimage").addClass('onsale').prepend('<div class="promoicon featuredProductStamp_On_Sale">Sale</div>');
12$(".featuredProduct").has(" .price.preDiscount").find(".featuredimage").addClass('onsale').prepend('<div class="promoicon featuredProductStamp_On_Sale">Sale</div>');
13};
14
15$(".featuredProductStamp_On_Sale").text("Sale");
16$(".featuredProductStamp_New_Item").text("New");
17$(".featuredProductStamp_Best_Seller").text("Hot");
18
19
20//CUSTOM STOCK LINK UNDER PRICE AREA
21
22if ( $("#prd_stock_enquiry").length > 0 ){
23
24$(".productPriceTableDetailed").append('<div class="stockenquiry"><div class="cmsFormElement" style="margin-top:1rem;font-size:90%;"><a href="#prd_stock_enquiry" onclick="jumptostock()">Notify me when back in stock</a></label></div></div>');
25
26};
27
28
29
30//EXTRA CLASSES FOR ALTBANNER
31$("#cmsAltBanner .column").has("img").addClass("imgCol");
32$("#cmsAltBanner .column").not("img").addClass("noImg");
33
34//IF TOP MENU HAS DROPDOWN
35$('#nav > .menulilink').each(function(){
36		$(this).has(".catsubmenu,.submenu").addClass("hassubmenu");
37});
38
39//ADD NOPADDING TO REMOVE EXTRA DRAG/DROP INDENT
40$("#cmsPageContent,#cmsPageHeader,#cmsPageFooter").has(".row").addClass("noPadding");
41
42
43//SET SECTION IDS TO ALLOW MENU LINKS DOWN CONTENTBOX PAGE
44//USED IN CONJ WITH SLIDE TO MENU BELOW
45//USE ROOT / TO WORK ON SUBPAGES E.G. /#is-section1
46
47$(".is-section").each(function(index){
48	$(this).attr("id","is-section"+(index+1));
49});
50
51//HOMEPAGE SLIDE TO MENU LINK ID (not active, change .homepage to .cmsHomePage)
52
53$('.homepage #menu a[href*="#"]:not([href="#"])').click(function() {
54    if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'') && location.hostname == this.hostname) {
55      var target = $(this.hash)
56      target = target.length ? target : $('[name=' + this.hash.slice(1) +']')
57      if (target.length) {
58        $('html,body').animate({
59          scrollTop: target.offset().top
60        }, 1000);
61        return false;
62      }
63    }
64  });
65
66
67//FIXEDHEADER CLASS ON SCROLL
68$(window).scroll(function() {    
69    var scroll = $(window).scrollTop();
70    var width = $(window).width();	
71    if (scroll >= 300 && width > 0) {
72        $("body").addClass("fixedHeader");
73    } else {
74        $("body").removeClass("fixedHeader");
75    }
76});
77
78
79});
80
81
82$(document).ready(function(){
83	mobilise();
84	menuise();
85});
86
87
88function mobilise() {
89
90$('.mobilemenucontainer').html('');
91$('.mobilecatmenucontainer').html('');
92
93//efficient use of page size by duplicating content
94$('.mobilemenucontainer').html($("#menu>#nav").html());
95$('.mobilecatmenucontainer').html($("#catmenu>#nav").html());
96
97//click button already in page
98$("#mobbtn").on('click',function(){
99$("body").addClass("mobilemenuactive");
100          $(window).scrollTop(0);
101});
102
103//overlay click exit       
104$(".is-mobile-menu .is-overlay").on('click',function(){
105 $("body").removeClass("mobilemenuactive");
106});
107
108//exit button exit
109$("#mobbtnx").on('click',function(){
110 $("body").removeClass("mobilemenuactive");
111});
112
113}
114
115function menuise(){
116
117//IF MENU ITEM HAS DROPDOWN
118$('.menulilink').has("ul").each(function(){
119	$(this).has(".catsubmenu,.submenu").addClass("hassubmenu inactive");
120	$(this).find("a:first").after('<button class="toggle"><div class="plus"></div></button>');
121	
122});
123
124$(".menuliactive,.selectedCategory.hassubmenu").removeClass("inactive").addClass("active");
125
126$(".hassubmenu button.toggle").click(function(e){
127	e.preventDefault();
128	$(this).parent().toggleClass("active inactive");
129});
130
131}
132
133
134function jumptostock(){
135
136$(".productTabContent").hide();
137$("#prd_stock_enquiry_div").show();
138$(".productTabLI a").removeClass("productTabAactive");
139$("#prd_stock_enquiry").addClass("productTabAactive");
140
141}

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.