PageSourceSearch

https://www.vpeniaze.sk/wp-content/themes/vpeniazesk/js/script.js?ver=1714544669

js vpeniaze.sk collected 2026-10-10 01:03:41 UTC 3,543 bytes, 140 lines download raw bytes

1
2var $header = $('header.header');
3var $menuBtn = $('.menu-btn');
4var $navigationWrap = $('.header-menu-wrap');
5var $blocker = $('.custom-blocker');
6var mobileNavigationBreakpoint = 600;
7let $headerSearchTargetWrap = $('.header-search-form-wrap');
8
9
10function toggleMenu() {
11	$headerSearchTargetWrap.removeClass('active');
12
13	if(!$navigationWrap.hasClass('active')) {
14		$navigationWrap.addClass('active');
15		$blocker.addClass('active');
16		$header.addClass('active');
17	}else {
18		$navigationWrap.removeClass('active');
19		$blocker.removeClass('active');
20		$header.removeClass('active');
21	}
22}
23
24$(document).ready(function(){
25	
26	/* FANCYBOX */
27		$.fancybox.defaults.hash = false;
28		$.fancybox.defaults.loop = true;
29		$('a[href$=".gif"], a[href$=".jpg"],  a[href$=".jpeg"],  a[href$=".png"], a[href$=".bmp"]').children('img').each(function( index ) {
30			$(this).parent().attr('data-fancybox', 'gallery').addClass('no-after');
31		});
32	/******* */
33
34	$("a[href^='#'], body.home a[href^='/#']").click(function (e) {
35		 e.preventDefault();
36
37		 var target = this.hash,
38		      $target = $(target);
39
40			if($target.length) {
41				$("html, body").stop().animate({
42				  "scrollTop": $target.offset().top
43				}, 400, "swing", function () {
44				  // window.location.hash = target;
45				});
46			}
47	}); 
48
49	
50	$('.header-search-form-wrap i').click(function (e) { 
51		e.preventDefault();
52		if($headerSearchTargetWrap.hasClass('active')) {
53			$headerSearchTargetWrap.removeClass('active');
54			$blocker.removeClass('active');
55		}else {
56			$blocker.addClass('active');
57			$headerSearchTargetWrap.addClass('active');			
58		}
59	});
60
61	$('body').on('click', '.target', function(event) {
62	});
63
64	$menuBtn.click(function (e) { 
65		e.preventDefault();
66		toggleMenu();
67	});
68
69	$blocker.click(function (e) { 
70		e.preventDefault();
71		toggleMenu();
72	});
73
74	$('.faq-item').click(function (e) { 
75		e.preventDefault();
76		if($(this).hasClass('active')) {
77			$(this).find('.content').slideUp(300);
78			$(this).removeClass('active');
79		}else {
80			$(this).find('.content').slideDown(300);
81			$(this).addClass('active');
82		}
83	});
84
85	$("figure.alignleft").parent().addClass("alignleft");
86	$("figure.alignright").parent().addClass("alignright");
87
88	//scrollování na daný H2 nadpis po kliknutí na obsah	
89	setTimeout(() => {
90		$(".single-left-col .wp-block-image img").each(function (index, element) {
91			// element == this
92			var width = $(this).attr("width");
93			var height = $(this).attr("height");
94			if(height && width) {
95				$(this).attr("style", "aspect-ratio: "+width+"/"+height);
96			}
97		});
98		
99	}, 500);
100
101	$(".article-content__link").click(function (e) {
102		e.preventDefault();
103
104		var i = $(this).data("i");
105		var text = $(this).text();
106		//var target = "h2:contains('"+text+"')";
107		var target = "h2:nth-of-type("+i+")";
108			$target = $(target);
109
110			console.log(target);
111
112		if($target.length) {
113			$("html, body").stop().animate({
114				"scrollTop": $target.offset().top - $("header").innerHeight() - 60
115			}, 400, "swing", function () {
116				// window.location.hash = target;
117			});
118
119		}
120	}); 
121
122
123}); //ready
124
125$(document).scroll(function() { 
126	scroll_pos = $(this).scrollTop();
127	if(scroll_pos > 0) {
128		$header.addClass('scrolled');
129	}else {
130		$header.removeClass('scrolled');
131	}
132
133	if($(window).innerWidth() <= mobileNavigationBreakpoint && $navigationWrap.hasClass('active')) {
134		toggleMenu();
135	}
136}); //scroll
137
138$(document).resize(function(event) {
139
140}); //resize

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.