PageSourceSearch

https://www.bargainsgroup.com/wp-content/themes/bargains-group%20live/js/custom.js?v=1790348182

js bargainsgroup.com collected 2026-09-25 14:57:03 UTC 15,807 bytes, 278 lines download raw bytes

1/*
2 Added by Sven to make header stick on scroll
3 Sticky-kit v1.1.2 | WTFPL | Leaf Corcoran 2015 | http://leafo.net
4*/
5(function(){var b,f;b=this.jQuery||window.jQuery;f=b(window);b.fn.stick_in_parent=function(d){var A,w,J,n,B,K,p,q,k,E,t;null==d&&(d={});t=d.sticky_class;B=d.inner_scrolling;E=d.recalc_every;k=d.parent;q=d.offset_top;p=d.spacer;w=d.bottoming;null==q&&(q=0);null==k&&(k=void 0);null==B&&(B=!0);null==t&&(t="is_stuck");A=b(document);null==w&&(w=!0);J=function(a,d,n,C,F,u,r,G){var v,H,m,D,I,c,g,x,y,z,h,l;if(!a.data("sticky_kit")){a.data("sticky_kit",!0);I=A.height();g=a.parent();null!=k&&(g=g.closest(k));
6if(!g.length)throw"failed to find stick parent";v=m=!1;(h=null!=p?p&&a.closest(p):b("<div />"))&&h.css("position",a.css("position"));x=function(){var c,f,e;if(!G&&(I=A.height(),c=parseInt(g.css("border-top-width"),10),f=parseInt(g.css("padding-top"),10),d=parseInt(g.css("padding-bottom"),10),n=g.offset().top+c+f,C=g.height(),m&&(v=m=!1,null==p&&(a.insertAfter(h),h.detach()),a.css({position:"",top:"",width:"",bottom:""}).removeClass(t),e=!0),F=a.offset().top-(parseInt(a.css("margin-top"),10)||0)-q,
7u=a.outerHeight(!0),r=a.css("float"),h&&h.css({width:a.outerWidth(!0),height:u,display:a.css("display"),"vertical-align":a.css("vertical-align"),"float":r}),e))return l()};x();if(u!==C)return D=void 0,c=q,z=E,l=function(){var b,l,e,k;if(!G&&(e=!1,null!=z&&(--z,0>=z&&(z=E,x(),e=!0)),e||A.height()===I||x(),e=f.scrollTop(),null!=D&&(l=e-D),D=e,m?(w&&(k=e+u+c>C+n,v&&!k&&(v=!1,a.css({position:"fixed",bottom:"",top:c}).trigger("sticky_kit:unbottom"))),e<F&&(m=!1,c=q,null==p&&("left"!==r&&"right"!==r||a.insertAfter(h),
8h.detach()),b={position:"",width:"",top:""},a.css(b).removeClass(t).trigger("sticky_kit:unstick")),B&&(b=f.height(),u+q>b&&!v&&(c-=l,c=Math.max(b-u,c),c=Math.min(q,c),m&&a.css({top:c+"px"})))):e>F&&(m=!0,b={position:"fixed",top:c},b.width="border-box"===a.css("box-sizing")?a.outerWidth()+"px":a.width()+"px",a.css(b).addClass(t),null==p&&(a.after(h),"left"!==r&&"right"!==r||h.append(a)),a.trigger("sticky_kit:stick")),m&&w&&(null==k&&(k=e+u+c>C+n),!v&&k)))return v=!0,"static"===g.css("position")&&g.css({position:"relative"}),
9a.css({position:"absolute",bottom:d,top:"auto"}).trigger("sticky_kit:bottom")},y=function(){x();return l()},H=function(){G=!0;f.off("touchmove",l);f.off("scroll",l);f.off("resize",y);b(document.body).off("sticky_kit:recalc",y);a.off("sticky_kit:detach",H);a.removeData("sticky_kit");a.css({position:"",bottom:"",top:"",width:""});g.position("position","");if(m)return null==p&&("left"!==r&&"right"!==r||a.insertAfter(h),h.remove()),a.removeClass(t)},f.on("touchmove",l),f.on("scroll",l),f.on("resize",
10y),b(document.body).on("sticky_kit:recalc",y),a.on("sticky_kit:detach",H),setTimeout(l,0)}};n=0;for(K=this.length;n<K;n++)d=this[n],J(b(d));return this}}).call(this);
11
12
13function dynamicCssStyle() {
14    jQuery(".rp-colL").css({
15        "min-height": jQuery(".rp-detail-form").outerHeight() + 30
16    }), jQuery("#customer_details > div").css({
17        "min-height": jQuery("#customer_details").height()
18    }), jQuery(".h-mobile-content").css({
19        height: jQuery(".h-mobile-content").height()
20    }), jQuery(".h-mobile-childnav").css({
21        height: jQuery(".h-mobile-content").height()
22    }), jQuery(".product-content-wrap").css({
23        width: jQuery(".product-detail").width() - jQuery(".prodcut-thumb-wrap").width() - jQuery(".product-action-wrap").width()
24    }), jQuery(".award-content").css({
25        width: jQuery(".awards").width() - jQuery(".award-img-wrap").width() - 35
26    }), jQuery(".blog-content").css({
27        width: jQuery(".blog-item").width() - jQuery(".blog-thumb").width() - 5
28    })
29}
30
31function sidecatToggle() {
32    jQuery(".sidebar-nav li, .sidebar-child-nav").toggleClass("close"), jQuery(".sidebar-child-nav .active").parents(".sidebar-child-nav").slideToggle().parents(".sidebar-child-nav").toggleClass("open close"), jQuery(".sidebar-child-nav .active").parents("li").toggleClass("open close"), jQuery(document).on("click", ".arrow", function() {
33        return jQuery(this).closest("ul").hasClass("sidebar-child-nav") && (jQuery(this).closest(".sidebar-child-nav").find("li").not(jQuery(this).parent().parent()).removeClass("open").addClass("close"), jQuery(this).closest("ul").find(".sidebar-child-nav").not(jQuery(this).parent().parent().find(".sidebar-child-nav")).slideUp(), jQuery(this).parent().parent().find(".sidebar-child-nav:first").slideToggle().parent().toggleClass("open close")), !1
34    }), jQuery(document).on("click", ".arrow", function() {
35        return jQuery(this).closest("ul").hasClass("sidebar-nav") && (jQuery(".sidebar-nav li.open").not(jQuery(this).parent().parent()).removeClass("open").addClass("close"), jQuery(".sidebar-child-nav").not(jQuery(this).parent().parent().find(".sidebar-child-nav")).slideUp(), jQuery(this).parent().parent().find(".sidebar-child-nav:first").slideToggle().parent().toggleClass("open close")), !1
36    })
37}
38
39function mobnavToggle() {
40    jQuery(document).on("click", ".menu-bar-blue", function() {
41        return jQuery(".h-mobile-content").slideToggle(), !1
42    }), jQuery(document).on("click", ".h-mobile-catnav .arrow", function() {
43        return jQuery(this).parent().parent().find(".h-mobile-childnav:first").slideToggle(), !1
44    }), jQuery(document).on("click", ".h-mobile-childnav .back", function() {
45        return jQuery(this).closest(".catBox").slideToggle(), !1
46    })
47}
48
49function mnavToggle() {
50    jQuery(document).on("click", ".main-cat span.arrow", function() {
51        return jQuery(".main-cat").removeClass("open"), jQuery(".h-shop-childnav").not(jQuery(this).parent().find(".h-shop-childnav")).slideUp(), jQuery(this).parent().find(".h-shop-childnav").slideToggle("slow", "swing", function() {
52            jQuery(".h-shop-child-subnav").css({
53                height: jQuery(".h-shop-nav").height() + 2
54            }), jQuery(".h-shop-childnav").each(function() {
55                "block" == jQuery(this).css("display") && jQuery(this).parent().addClass("open")
56            })
57        }), !1
58    }), jQuery(".main-cat").each(function(e) {
59        var r = parseInt(jQuery(".main-cat .arrow").css("height")) * e + parseInt(jQuery(".h-shop-nav").css("padding-top"));
60        jQuery(".main-cat:nth-child(" + parseInt(e + 1) + ") .h-shop-child-subnav").css("top", "-" + r + "px")
61    })
62}
63
64jQuery(document).ready(function() {
65		//Use to stick Header section on scroll
66		$('.stick-in-parent').stick_in_parent({
67                parent: '.main-wrapper',
68                spacer: false
69		}); 
70        dynamicCssStyle(), mnavToggle(), sidecatToggle(), mobnavToggle(), jQuery(window).bind("resize", function() {
71            dynamicCssStyle()
72        })
73    }), jQuery(function() {
74        jQuery(".flexslider").flexslider({
75            controlNav: !0,
76            directionNav: !0,
77            keyboard: !0,
78            slideshow: !0,
79            animation: "slide",
80            pausePlay: !0
81        })
82    }), equalheight = function(e) {
83        var r, i = 0,
84            t = 0,
85            a = new Array;
86        jQuery(e).each(function() {
87            if (r = jQuery(this), jQuery(r).height("auto"), topPostion = r.position().top, t != topPostion) {
88                for (currentDiv = 0; currentDiv < a.length; currentDiv++) a[currentDiv].height(i);
89                a.length = 0, t = topPostion, i = r.height(), a.push(r)
90            } else a.push(r), i = i < r.height() ? r.height() : i;
91            for (currentDiv = 0; currentDiv < a.length; currentDiv++) a[currentDiv].height(i);
92            return i
93        })
94    }, jQuery(window).load(function() {
95        equalheight(".category-product-items h3"), equalheight(".category-product-info"), equalheight(".category-product-items .category-product-image"), equalheight(".related-products-item h3"), equalheight(".related-products-item .related-product-image"), equalheight(".bg-pc-wrap .eh"), equalheight(".fc-greybox"), equalheight(".gb-hosts-content"), equalheight(".gb-donation-content")
96    }), jQuery(window).resize(function() {
97        equalheight(".category-product-items h3"), equalheight(".category-product-info"), equalheight(".category-product-items .category-product-image"), equalheight(".related-products-item h3"), equalheight(".related-products-item .related-product-image"), equalheight(".bg-pc-wrap .eh"), equalheight(".fc-greybox"), equalheight(".gb-hosts-content"), equalheight(".gb-donation-content")
98    }),
99    jQuery(function() {
100        function e() {
101            var e = jQuery("#p_search").val().trim();
102            return e.length < 3 ?
103                void jQuery("#suggesstion-box").hide() :
104                void jQuery.ajax({
105                    method: "POST",
106                    url: ajaxurl,
107                    dataType: "html",
108                    data: {
109                        action: "bg_product_search",
110                        p_search: e,
111                        category: jQuery(".category").val()
112                    },
113                    beforeSend: function() {},
114                    success: function(e) {
115                        jQuery("#suggesstion-box").show(), jQuery("#suggesstion-box").html(e)
116                    }
117                });
118            jQuery("#suggesstion-box").html('<ul class="search_result"><li>Loading</li></ul>');
119        }
120        jQuery("select.category").on("change", function() {
121            e()
122        }), jQuery("#p_search").keyup(function(r) {
123            13 == r.which && jQuery("input.h-search-btn").trigger("click"), setTimeout(function() {
124                e()
125            }, 0)
126        }), jQuery("input.h-search-btn").on("click", function() {
127            var e = jQuery("#p_search").val().trim(),
128                r = jQuery(".header-search .category").val();
129            e.length > 0 && (r = r ? "&product_cat=" + r : "", location.href = home_url + "/?s=" + e + "&dgwt_wcas=1&post_type=product" + r)
130        }), jQuery(".header-search .row").click(function() {
131            jQuery("#suggesstion-box").show()
132        }), jQuery("body").on("click", ":not(.header-search .row input)", function(e) {
133            jQuery(e.target).closest(".header-search .row").length || jQuery("#suggesstion-box").hide()
134        }), jQuery("body").on("click", ":not(.header-cart img)", function(e) {
135            jQuery(e.target).closest(".header-cart img").length || jQuery(".h-cart-dropdown").hide()
136        }), jQuery(".header-cart img").click(function() {
137            jQuery(".h-cart-dropdown").toggle()
138        }), jQuery(".header-cart").hover(function() {
139            jQuery(".h-cart-dropdown").show()
140        }, function() {
141            jQuery(".h-cart-dropdown").show()
142        }), jQuery(".price_slider").on("click", function() {
143            jQuery(this).closest("form").submit()
144        }), jQuery.validator.addMethod("customemail", function(e, r) {
145            return /^([a-zA-Z0-9_\.\-\+])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/.test(e)
146        }, "Please Enter a valid email address"), jQuery.validator.addMethod("alpha", function(e, r) {
147            return this.optional(r) || e == e.match(/^[a-zA-Z' ]*$/) && "test" != e.toLowerCase()
148        }), jQuery.validator.addMethod("numbers", function(e, r) {
149            return this.optional(r) || e == e.match(/^[0-9]+$/)
150        }), jQuery.validator.addMethod("notEqual", function(e, r, i) {
151            return this.optional(r) || e.toLowerCase() != jQuery(i).val().toLowerCase()
152        }, "Last name cannot be same as the First Name");
153        jQuery(".product-help-form .news-l-form").validate({
154            errorPlacement: function(e, r) {
155                e.insertAfter(r)
156            },
157            errorElement: "span",
158            rules: {
159                inf_field_FirstName: {
160                    required: !0,
161                    alpha: !0
162                },
163                inf_field_LastName: {
164                    required: !0,
165                    notEqual: "#inf_field_FirstName",
166                    alpha: !0
167                },
168                inf_field_Phone1: {
169                    required: !0
170                },
171                inf_field_Email: {
172                    required: !0,
173                    customemail: !0
174                },
175                inf_custom_Message: {
176                    required: !0
177                }
178            },
179            messages: {
180                inf_field_FirstName: {
181                    required: "This field is required",
182                    alpha: "Please enter a valid name"
183                },
184                inf_field_LastName: {
185                    required: "This field is required",
186                    notEqual: "Last Name can't be same as First Name",
187                    alpha: "Please enter a valid name"
188                },
189                inf_field_Phone1: {
190                    required: "This field is required"
191                },
192                inf_field_Email: {
193                    required: "This field is required",
194                    customemail: "Enter a valid email address"
195                },
196                inf_custom_Message: {
197                    required: "This field is required"
198                }
199            },
200            submitHandler: function(e) {
201                return !0
202            }
203        }), jQuery(".bg-alert-wrap .news-l-form").validate({
204            errorPlacement: function(e, r) {
205                e.insertAfter(r)
206            },
207            errorElement: "span",
208            rules: {
209                inf_field_FirstName: {
210                    required: !0,
211                    alpha: !0
212                },
213                inf_field_LastName: {
214                    required: !0,
215                    notEqual: "#inf_field_FirstName",
216                    alpha: !0
217                },
218                inf_field_Email: {
219                    required: !0,
220                    customemail: !0
221                }
222            },
223            messages: {
224                inf_field_FirstName: {
225                    required: "This field is required.",
226                    alpha: "Please enter a valid name"
227                },
228                inf_field_LastName: {
229                    required: "This field is required.",
230                    notEqual: "Last Name can't be same as First Name",
231                    alpha: "Please enter a valid name"
232                },
233                inf_field_Email: {
234                    required: "This field is required.",
235                    customemail: "Enter a valid email address"
236                }
237            },
238            submitHandler: function(e) {
239                return !0
240            }
241        })
242    });
243
244
245jQuery(document).ready(function() {
246    jQuery(window).load(function() {
247        var pheight = jQuery(".custom .slider-content p").outerHeight();
248        var spanheight = jQuery(".custom .slider-content span").outerHeight();
249        var finalval = parseInt(pheight) + parseInt(spanheight);
250        jQuery(".custom .slider-content").css({
251            "height": finalval
252        })
253    });
254    
255    
256
257    jQuery(window).bind("resize", function() {
258        var pheight = jQuery(".custom .slider-content p").outerHeight();
259        var spanheight = jQuery(".custom .slider-content span").outerHeight();
260        var finalval = parseInt(pheight) + parseInt(spanheight);
261        jQuery(".custom .slider-content").css({
262            "height": finalval
263        })
264    });
265});
266
267
268jQuery(window).load(function() {
269	equalheight(".category-product-items h3");
270	equalheight(".category-product-info");
271	equalheight(".category-product-items .category-product-image");
272	equalheight(".related-products-item h3");
273	equalheight(".related-products-item .related-product-image");
274	equalheight(".bg-pc-wrap .eh");
275	equalheight(".fc-greybox");
276	equalheight(".gb-hosts-content");
277	equalheight(".gb-donation-content");
278});

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.