PageSourceSearch

https://hungaroring.hu/shop/assets/js/main.js

js hungaroring.hu collected 2026-10-02 10:24:16 UTC 24,197 bytes, 626 lines download raw bytes

1$(function() {
2    
3    "use strict";
4    
5    /*=============================================
6    =                Prealoder                  =
7    =============================================*/
8    
9    $(window).on('load', function(event) {
10        $('#preloader').delay(500).fadeOut(500);
11    });
12    
13    /*=====  End of Prealoder  ======*/
14
15    
16    /*=============================================
17    =                   Sticky                   =
18    =============================================*/
19    
20    $(window).on('scroll', function(event) {    
21        var scroll = $(window).scrollTop();
22        if (scroll < 350) {
23            $(".navigation").removeClass("sticky");
24        } else{
25            $(".navigation").addClass("sticky");
26        }
27    });
28
29    /*=====  End of Sticky  ======*/   
30    
31
32    /*=============================================
33    =             Mobile Script                   =
34    =============================================*/
35   
36
37    // Script Navigation
38	! function(n, e, i, a) {
39		n.navigation = function(t, s) {
40			var o = {
41					responsive: !0,
42					mobileBreakpoint:991,
43					showDuration: 300,
44					hideDuration: 300,
45					showDelayDuration: 0,
46					hideDelayDuration: 0,
47					submenuTrigger: "hover",
48					effect: "fade",
49					submenuIndicator: !0,
50					hideSubWhenGoOut: !0,
51					visibleSubmenusOnMobile: !1,
52					fixed: !1,
53					overlay: !0,
54					overlayColor: "rgba(0, 0, 0, 0.5)",
55					hidden: !1,
56					offCanvasSide: "left",
57					onInit: function() {},
58					onShowOffCanvas: function() {},
59					onHideOffCanvas: function() {}
60				},
61				u = this,
62				r = Number.MAX_VALUE,
63				d = 1,
64				f = "click.nav touchstart.nav",
65				l = "mouseenter.nav",
66				c = "mouseleave.nav";
67			u.settings = {};
68			var t = (n(t), t);
69			n(t).find(".nav-menus-wrapper").prepend("<span class='nav-menus-wrapper-close-button'>✕</span>"), n(t).find(".nav-search").length > 0 && n(t).find(".nav-search").find("form").prepend("<span class='nav-search-close-button'>✕</span>"), u.init = function() {
70				u.settings = n.extend({}, o, s), "right" == u.settings.offCanvasSide && n(t).find(".nav-menus-wrapper").addClass("nav-menus-wrapper-right"), u.settings.hidden && (n(t).addClass("navigation-hidden"), u.settings.mobileBreakpoint = 99999), v(), u.settings.fixed && n(t).addClass("navigation-fixed"), n(t).find(".nav-toggle").on("click touchstart", function(n) {
71					n.stopPropagation(), n.preventDefault(), u.showOffcanvas(), s !== a && u.callback("onShowOffCanvas")
72				}), n(t).find(".nav-menus-wrapper-close-button").on("click touchstart", function() {
73					u.hideOffcanvas(), s !== a && u.callback("onHideOffCanvas")
74				}), n(t).find(".nav-search-button").on("click touchstart", function(n) {
75					n.stopPropagation(), n.preventDefault(), u.toggleSearch()
76				}), n(t).find(".nav-search-close-button").on("click touchstart", function() {
77					u.toggleSearch()
78				}), n(t).find(".megamenu-tabs").length > 0 && y(), n(e).resize(function() {
79					m(), C()
80				}), m(), s !== a && u.callback("onInit")
81			};
82			var v = function() {
83				n(t).find("li").each(function() {
84					n(this).children(".nav-dropdown,.megamenu-panel").length > 0 && (n(this).children(".nav-dropdown,.megamenu-panel").addClass("nav-submenu"), u.settings.submenuIndicator && n(this).children("a").append("<span class='submenu-indicator'><span class='submenu-indicator-chevron'></span></span>"))
85				})
86			};
87			u.showSubmenu = function(e, i) {
88				g() > u.settings.mobileBreakpoint && n(t).find(".nav-search").find("form").slideUp(), "fade" == i ? n(e).children(".nav-submenu").stop(!0, !0).delay(u.settings.showDelayDuration).slideDown(u.settings.showDuration) : n(e).children(".nav-submenu").stop(!0, !0).delay(u.settings.showDelayDuration).slideDown(u.settings.showDuration), n(e).addClass("nav-submenu-open")
89            },
90             u.hideSubmenu = function(e, i) {
91				"fade" == i ? n(e).find(".nav-submenu").stop(!0, !0).delay(u.settings.hideDelayDuration).slideUp(u.settings.hideDuration) : n(e).find(".nav-submenu").stop(!0, !0).delay(u.settings.hideDelayDuration).slideUp(u.settings.hideDuration), n(e).removeClass("nav-submenu-open").find(".nav-submenu-open").removeClass("nav-submenu-open")
92			};
93			var h = function() {
94					n("body").addClass("no-scroll"), u.settings.overlay && (n(t).append("<div class='nav-overlay-panel'></div>"), n(t).find(".nav-overlay-panel").css("background-color", u.settings.overlayColor).fadeIn(300).on("click touchstart", function(n) {
95						u.hideOffcanvas()
96					}))
97				},
98				p = function() {
99					n("body").removeClass("no-scroll"), u.settings.overlay && n(t).find(".nav-overlay-panel").fadeOut(400, function() {
100						n(this).remove()
101					})
102				};
103			u.showOffcanvas = function() {
104				h(), "left" == u.settings.offCanvasSide ? n(t).find(".nav-menus-wrapper").css("transition-property", "left").addClass("nav-menus-wrapper-open") : n(t).find(".nav-menus-wrapper").css("transition-property", "right").addClass("nav-menus-wrapper-open")
105			}, u.hideOffcanvas = function() {
106				n(t).find(".nav-menus-wrapper").removeClass("nav-menus-wrapper-open").on("webkitTransitionEnd moztransitionend transitionend oTransitionEnd", function() {
107					n(t).find(".nav-menus-wrapper").css("transition-property", "none").off()
108				}), p()
109			}, u.toggleOffcanvas = function() {
110				g() <= u.settings.mobileBreakpoint && (n(t).find(".nav-menus-wrapper").hasClass("nav-menus-wrapper-open") ? (u.hideOffcanvas(), s !== a && u.callback("onHideOffCanvas")) : (u.showOffcanvas(), s !== a && u.callback("onShowOffCanvas")))
111			}, u.toggleSearch = function() {
112				"none" == n(t).find(".nav-search").find("form").css("display") ? (n(t).find(".nav-search").find("form").slideDown(), n(t).find(".nav-submenu").fadeOut(200)) : n(t).find(".nav-search").find("form").slideUp()
113			};
114			var m = function() {
115					u.settings.responsive ? (g() <= u.settings.mobileBreakpoint && r > u.settings.mobileBreakpoint && (n(t).addClass("navigation-portrait").removeClass("navigation-landscape"), D()), g() > u.settings.mobileBreakpoint && d <= u.settings.mobileBreakpoint && (n(t).addClass("navigation-landscape").removeClass("navigation-portrait"), k(), p(), u.hideOffcanvas()), r = g(), d = g()) : k()
116				},
117				b = function() {
118					n("body").on("click.body touchstart.body", function(e) {
119						0 === n(e.target).closest(".navigation").length && (n(t).find(".nav-submenu").fadeOut(), n(t).find(".nav-submenu-open").removeClass("nav-submenu-open"), n(t).find(".nav-search").find("form").slideUp())
120					})
121				},
122				g = function() {
123					return e.innerWidth || i.documentElement.clientWidth || i.body.clientWidth
124				},
125				w = function() {
126					n(t).find(".nav-menu").find("li, a").off(f).off(l).off(c)
127				},
128				C = function() {
129					if (g() > u.settings.mobileBreakpoint) {
130						var e = n(t).outerWidth(!0);
131						n(t).find(".nav-menu").children("li").children(".nav-submenu").each(function() {
132							n(this).parent().position().left + n(this).outerWidth() > e ? n(this).css("right", 0) : n(this).css("right", "auto")
133						})
134					}
135				},
136				y = function() {
137					function e(e) {
138						var i = n(e).children(".megamenu-tabs-nav").children("li"),
139							a = n(e).children(".megamenu-tabs-pane");
140						n(i).on("click.tabs touchstart.tabs", function(e) {
141							e.stopPropagation(), e.preventDefault(), n(i).removeClass("active"), n(this).addClass("active"), n(a).hide(0).removeClass("active"), n(a[n(this).index()]).show(0).addClass("active")
142						})
143					}
144					if (n(t).find(".megamenu-tabs").length > 0)
145						for (var i = n(t).find(".megamenu-tabs"), a = 0; a < i.length; a++) e(i[a])
146				},
147				k = function() {
148					w(), n(t).find(".nav-submenu").hide(0), navigator.userAgent.match(/Mobi/i) || navigator.maxTouchPoints > 0 || "click" == u.settings.submenuTrigger ? n(t).find(".nav-menu, .nav-dropdown").children("li").children("a").on(f, function(i) {
149						if (u.hideSubmenu(n(this).parent("li").siblings("li"), u.settings.effect), n(this).closest(".nav-menu").siblings(".nav-menu").find(".nav-submenu").fadeOut(u.settings.hideDuration), n(this).siblings(".nav-submenu").length > 0) {
150							if (i.stopPropagation(), i.preventDefault(), "none" == n(this).siblings(".nav-submenu").css("display")) return u.showSubmenu(n(this).parent("li"), u.settings.effect), C(), !1;
151							if (u.hideSubmenu(n(this).parent("li"), u.settings.effect), "_blank" == n(this).attr("target") || "blank" == n(this).attr("target")) e.open(n(this).attr("href"));
152							else {
153								if ("#" == n(this).attr("href") || "" == n(this).attr("href")) return !1;
154								e.location.href = n(this).attr("href")
155							}
156						}
157					}) : n(t).find(".nav-menu").find("li").on(l, function() {
158						u.showSubmenu(this, u.settings.effect), C()
159					}).on(c, function() {
160						u.hideSubmenu(this, u.settings.effect)
161					}), u.settings.hideSubWhenGoOut && b()
162				},
163				D = function() {
164					w(), n(t).find(".nav-submenu").hide(0), u.settings.visibleSubmenusOnMobile ? n(t).find(".nav-submenu").show(0) : (n(t).find(".nav-submenu").hide(0), n(t).find(".submenu-indicator").removeClass("submenu-indicator-up"), u.settings.submenuIndicator ? n(t).find(".submenu-indicator").on(f, function(e) {
165						return e.stopPropagation(), e.preventDefault(), u.hideSubmenu(n(this).parent("a").parent("li").siblings("li"), "slide"), u.hideSubmenu(n(this).closest(".nav-menu").siblings(".nav-menu").children("li"), "slide"), "none" == n(this).parent("a").siblings(".nav-submenu").css("display") ? (n(this).addClass("submenu-indicator-up"), n(this).parent("a").parent("li").siblings("li").find(".submenu-indicator").removeClass("submenu-indicator-up"), n(this).closest(".nav-menu").siblings(".nav-menu").find(".submenu-indicator").removeClass("submenu-indicator-up"), u.showSubmenu(n(this).parent("a").parent("li"), "slide"), !1) : (n(this).parent("a").parent("li").find(".submenu-indicator").removeClass("submenu-indicator-up"), void u.hideSubmenu(n(this).parent("a").parent("li"), "slide"))
166					}) : k())
167				};
168			u.callback = function(n) {
169				s[n] !== a && s[n].call(t)
170			}, u.init()
171		}, n.fn.navigation = function(e) {
172			return this.each(function() {
173				if (a === n(this).data("navigation")) {
174					var i = new n.navigation(this, e);
175					n(this).data("navigation", i)
176				}
177			})
178		}
179	}
180	(jQuery, window, document), $(document).ready(function() {
181		$("#navigation").navigation()
182	});
183
184
185    /*=====  End of Mobile Mean menu  ======*/   
186    
187
188    /*=============================================
189    =                 Slick Slider                =
190    =============================================*/
191    
192    function mainSlider() {
193            
194        var BasicSlider = $('.slider-active');
195            
196        BasicSlider.on('init', function(e, slick) {
197            var $firstAnimatingElements = $('.single-slider:first-child').find('[data-animation]');
198            doAnimations($firstAnimatingElements);
199        });
200            
201        BasicSlider.on('beforeChange', function(e, slick, currentSlide, nextSlide) {
202            var $animatingElements = $('.single-slider[data-slick-index="' + nextSlide + '"]').find('[data-animation]');
203            doAnimations($animatingElements);
204        });
205            
206        BasicSlider.slick({
207            autoplay: true,
208            autoplaySpeed: 10000,
209            pauseOnHover: false,
210            dots: false,
211            fade: true,
212			arrows: true,
213            prevArrow:'<span class="prev"><i class="fal fa-chevron-left"></i></span>',
214            nextArrow: '<span class="next"><i class="fal fa-chevron-right"></i></span>',
215            responsive: [
216                { breakpoint: 767, settings: {} }
217            ]
218        });
219
220        function doAnimations(elements) {
221            var animationEndEvents = 'webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend';
222            elements.each(function() {
223                var $this = $(this);
224                var $animationDelay = $this.data('delay');
225                var $animationType = 'animated ' + $this.data('animation');
226                $this.css({
227                    'animation-delay': $animationDelay,
228                    '-webkit-animation-delay': $animationDelay
229                });
230                $this.addClass($animationType).one(animationEndEvents, function() {
231                    $this.removeClass($animationType);
232                });
233            });
234        }
235    }
236    mainSlider();
237
238    /*=====  End of Slick Slider  ======*/
239    
240
241    /*=============================================
242    =              Magnific Popup                 =
243    =============================================*/
244
245    $('.video-popup').magnificPopup({
246        type: 'iframe'
247        // other options
248    });
249
250    $('.image-popup').magnificPopup({
251        type: 'image',
252        gallery:{
253          enabled:true
254        }
255    });
256
257    /*=====  End of Magnific Popup ======*/
258
259
260    /*=============================================
261    =         specialty Hover Active             =
262    =============================================*/
263
264    
265    $('.specialty-area').on('mouseover', '.single-specialty', function() {
266        $('.single-specialty.active').removeClass('active');
267        $(this).addClass('active');
268    });
269
270    /*=====  End of specialty Hover Active ======*/
271       
272    
273    /*=============================================
274    =           Slick Campus Image               =
275    =============================================*/   
276
277    $('.campus-image').slick({
278        dots: false,
279        infinite: false,
280        arrows: true,
281        prevArrow:'<span class="prev"><i class="fal fa-chevron-left"></i>Prev</span>',
282        nextArrow: '<span class="next">Next <i class="fal fa-chevron-right"></i></span>',
283        speed: 800,
284        slidesToShow: 1,
285        slidesToScroll: 1,
286    });
287
288    /*===== End of Slick Campus Image ======*/
289       
290    
291    /*=============================================
292    =             Slick Testimonials              =
293    =============================================*/
294    
295    $('.testimonials-image').slick({
296        slidesToShow: 1,
297        slidesToScroll: 1,
298        dots: false,
299        fade: true,
300        asNavFor: '.testimonials-content',
301        speed: 800,
302        arrows: true,
303        prevArrow: false,
304        nextArrow: '<span class="next">Next <i class="far fa-long-arrow-right"></i></span>',
305    });
306    
307    $('.testimonials-content').slick({
308        slidesToShow: 1,
309        slidesToScroll: 1,
310        asNavFor: '.testimonials-image',
311        dots: false,
312        arrows: false,
313        focusOnSelect: true,
314        speed: 800,
315    });    
316
317    /*===== End of Slick Testimonials ======*/
318
319
320    /*=============================================
321    =                 Counter Up                  =
322    =============================================*/
323
324    if($('.count').length){
325        $('.count').appear(function () {
326            $(this).prop('Counter',0).animate({
327                Counter: $(this).text()
328            }, {
329                duration: 4000,
330                easing: 'swing',
331                step: function (now) {
332                    $(this).text(Math.ceil(now));
333                }
334            });
335        },{accY: 0});
336    }
337
338    /*=====  End of Counter Up  ======*/
339
340
341    /*=============================================
342    =             Slick Blog Active               =
343    =============================================*/
344
345    $('.blog-active').slick({
346        dots: false,
347        infinite: false,
348        arrows: false,
349        prevArrow:'<span class="prev"><i class="fal fa-chevron-left"></i></span>',
350        nextArrow: '<span class="next"><i class="fal fa-chevron-right"></i></span>',
351        autoplay: true,
352        speed: 800,
353        slidesToShow: 3,
354        slidesToScroll: 1,
355        responsive: [
356            {
357              breakpoint: 992,
358              settings: {
359                slidesToShow: 2,
360              }
361            },
362            {
363              breakpoint: 768,
364              settings: {
365                slidesToShow: 1,
366              }
367            },
368            {
369              breakpoint: 576,
370              settings: {
371                slidesToShow: 1,
372              }
373            }
374        ]
375    });
376
377    /*=====  End of Slick Collection Active  ======*/
378
379    
380    /*=============================================
381    =               Isotope Filter                =
382    =============================================*/
383
384    $('.container').imagesLoaded(function () {
385        var $grid = $('.grid').isotope({
386        // options            
387            transitionDuration: '1s',
388        });
389        
390        // filter items on button click
391        $('.menu-items').on( 'click', 'li', function() {
392          var filterValue = $(this).attr('data-filter');
393          $grid.isotope({ filter: filterValue });
394        });
395        
396        //for menu active class
397        $('.menu-items li').on('click', function (event) {
398            $(this).siblings('.active').removeClass('active');
399            $(this).addClass('active');
400            event.preventDefault();
401        });
402    });
403
404    /*=====  End of Isotope Filter ======*/
405       
406    
407    /*=============================================
408    =             Gallery Masonry                 =
409    =============================================*/
410
411    $('.container').imagesLoaded(function () {
412
413        var $grid = $('.grid-masonry').isotope({
414            // options            
415            itemSelector: '.grid-item',
416            percentPosition: true,
417            masonry: {
418                // use outer width of grid-sizer for columnWidth
419                columnWidth: 1,
420            },
421        });
422    });
423
424    /*=====  End of Gallery Masonry ======*/
425       
426    
427    /*=============================================
428    =               Rating Active                 =
429    =============================================*/
430
431    /* 1. Visualizing things on Hover - See next part for action on click */
432    $('#stars li').on('mouseover', function(){
433        var onStar = parseInt($(this).data('value'), 10); // The star currently mouse on
434        
435        // Now highlight all the stars that's not after the current hovered star
436        $(this).parent().children('li.star').each(function(e){
437            if (e < onStar) {
438                $(this).addClass('hover');
439            }
440            else {
441                $(this).removeClass('hover');
442            }
443        });
444        
445    }).on('mouseout', function(){
446        $(this).parent().children('li.star').each(function(e){
447            $(this).removeClass('hover');
448        });
449    });
450    
451    
452    /* 2. Action to perform on click */
453    var spansCounts =  $('#stars li').length
454    $('#stars li').on('click', function(e) {
455        console.log($(this).index())
456        $('#stars li').removeClass('selected');
457
458        for(var i=0 ; i < $(this).index() + 1; i++){
459            $('#stars li').eq(i).addClass('selected')
460        }
461    })    
462
463    /*=====  End of Rating Active ======*/
464
465
466    /*=============================================
467    =           Product Size Active               =
468    =============================================*/
469
470	$('.product-size li').on("click", function() {
471		$(this).siblings(this).removeClass('active').end().addClass('active');
472	});
473    
474    /*=====  End of Product Size Active ======*/
475
476
477    /*=============================================
478    =           Product Color Active               =
479    =============================================*/
480
481    $('.product-color li').each(function() {
482		var get_color = $(this).attr('data-color');
483		$(this).css("background-color", get_color);
484    });
485    
486	$('.product-color li').on("click", function() {
487		$(this).siblings(this).removeClass('active').end().addClass('active');
488    });
489    
490    /*=====  End of Product Size Active ======*/
491    
492    
493    /*=============================================
494    =             product quantity                =
495    =============================================*/
496
497    $('.add').on('click', function () {
498		var qlimiter = parseInt($('#qlimiter').val());
499		
500        if ($(this).prev().val() < qlimiter ) {
501            $(this).prev().val(+$(this).prev().val() + 1);
502			console.log(qlimiter);
503        }
504    });
505    $('.sub').on('click', function () {
506        if ($(this).next().val() > 1) {
507            if ($(this).next().val() > 1) $(this).next().val(+$(this).next().val() - 1);
508        }
509    });
510
511    /*=====  End of product quantity ======*/
512
513    
514    /*=============================================
515    =                WOW active                   =
516    =============================================*/
517
518    // Iterate over each select element
519    $('select').each(function() {
520
521        // Cache the number of options
522        var $this = $(this),
523        numberOfOptions = $(this).children('option').length;
524    
525        // Hides the select element
526        $this.addClass('s-hidden');
527    
528        // Wrap the select element in a div
529        $this.wrap('<div class="select"></div>');
530    
531        // Insert a styled div to sit over the top of the hidden select element
532        $this.after('<div class="styledSelect"></div>');
533    
534        // Cache the styled div
535        var $styledSelect = $this.next('div.styledSelect');
536    
537        // Show the first select option in the styled div
538        $styledSelect.text($this.children('option').eq(0).text());
539    
540        // Insert an unordered list after the styled div and also cache the list
541        var $list = $('<ul />', {
542            'class': 'options'
543        }).insertAfter($styledSelect);
544    
545        // Insert a list item into the unordered list for each select option
546        for (var i = 0; i < numberOfOptions; i++) {
547        $('<li />', {
548            text: $this.children('option').eq(i).text(),
549            rel: $this.children('option').eq(i).val()
550        }).appendTo($list);
551        }
552    
553        // Cache the list items
554        var $listItems = $list.children('li');
555    
556        // Show the unordered list when the styled div is clicked (also hides it if the div is clicked again)
557        $styledSelect.on('click',function(e) {
558            e.stopPropagation();
559            $('div.styledSelect.active').each(function() {
560                $(this).removeClass('active').next('ul.options').hide();
561            });
562            $(this).toggleClass('active').next('ul.options').toggle();
563        });
564    
565        // Hides the unordered list when a list item is clicked and updates the styled div to show the selected list item
566        // Updates the select element to have the value of the equivalent option
567        $listItems.on('click',function(e) {
568            e.stopPropagation();
569            $styledSelect.text($(this).text()).removeClass('active');
570            $this.val($(this).attr('rel'));
571            $list.hide();
572        	chk_delivery(); //CSK
573			/* alert($this.val()); Uncomment this for demonstration! */
574        });
575    
576        // Hides the unordered list when clicking outside of it
577        $(document).on('click', function() {
578            $styledSelect.removeClass('active');
579            $list.hide();
580        });
581    
582    });
583
584    /*=====  End of product quantity ======*/
585
586    
587    /*=============================================
588    =                WOW active                   =
589    =============================================*/
590    
591    var wow = new WOW({
592        boxClass: 'wow', //
593        mobile: false, // 
594    })
595    wow.init();
596
597    /*=====  End of WOW active ======*/
598
599    
600    /*=============================================
601    =                Back to top                  =
602    =============================================*/
603
604    // Show or hide the sticky footer button
605    $(window).on('scroll', function(event) {
606        if($(this).scrollTop() > 600){
607            $('.back-to-top').fadeIn(200)
608        } else{
609            $('.back-to-top').fadeOut(200)
610        }
611    });
612    
613    
614    //Animate the scroll to yop
615    $('.back-to-top').on('click', function(event) {
616        event.preventDefault();
617        
618        $('html, body').animate({
619            scrollTop: 0,
620        }, 1500);
621    });
622
623    /*=====  End of Back to top ======*/    
624    
625    
626});

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.