PageSourceSearch

https://suedharz-urlaub.de/wp-content/themes/gowilds/assets/js/main.js?ver=7.1.3

js suedharz-urlaub.de collected 2026-10-10 00:30:55 UTC 14,528 bytes, 448 lines download raw bytes

1(function($) {
2  	"use strict";
3  	var GaviasTheme = {
4		init: function(){
5			this.handleWindow();
6			this.initResponsive();
7			this.initCarousel();
8			this.menuMobile();
9			this.postMasonry();
10			this.scrollTop();
11			this.stickyMenu();
12			this.user();
13			this.booking();
14			this.other();
15		},
16
17		handleWindow: function(){
18	 		var body = document.querySelector('body');
19        if (window.innerWidth > body.clientWidth + 6) {
20            body.classList.add('has-scrollbar');
21            body.setAttribute('style', '--scroll-bar: ' + (window.innerWidth - body.clientWidth) + 'px');
22        } else {
23            body.classList.remove('has-scrollbar');
24        }
25
26        	setTimeout(function(){
27          	if($('body').hasClass('gowilds-body-loading')){
28              $('body').removeClass('gowilds-body-loading');
29              $('.gowilds-page-loading').fadeOut(50);
30          	}
31      	}, 360);
32	 	},
33	 	
34	 	initResponsive: function(){
35		  	var _event = $.event,
36		  	$special, resizeTimeout;
37		  	$special = _event.special.debouncedresize = {
38				setup: function () {
39					$(this).on("resize", $special.handler);
40				},
41			 	teardown: function () {
42					$(this).off("resize", $special.handler);
43			 	},
44			 	handler: function (event, execAsap) {
45					var context = this,
46				  		args = arguments,
47				  		dispatch = function () {
48					 		event.type = "debouncedresize";
49					 		_event.dispatch.apply(context, args);
50				  		};
51				  	if (resizeTimeout) {
52					 	clearTimeout(resizeTimeout);
53				  	}
54					execAsap ? dispatch() : resizeTimeout = setTimeout(dispatch, $special.threshold);
55			 	},
56		  		threshold: 150
57			};
58	 	},
59
60	 	initCarousel: function(){
61			var _default = {
62				items: 3, 
63				items_lg: 3,
64				items_md: 2,
65				items_sm: 2,
66				items_xs: 1,
67				items_xx: 1,
68				space_between: 30,
69				effect: 'slide',
70				loop: 1,
71				speed: 600,
72				autoplay: 1,
73				autoplay_delay: 6000,
74				autoplay_hover: 0,
75				navigation: 1,
76				pagination: 1,
77				pagination_type: 'bullets',
78				dynamic_bullets: 0
79			};
80
81			$('.init-carousel-swiper-theme').each(function(){
82				var $target = $(this);
83				var settings = $target.data('carousel');
84
85				settings = $.extend(!0, _default, settings);
86				
87				//-- Autoplay
88				var _autoplay = false;
89				if(settings.autoplay){
90					_autoplay = {
91						delay: settings.autoplay_delay,
92						disableOnInteraction: false,
93						pauseOnMouseEnter: settings.autoplay_hover,
94					}
95				}
96				//-- Pagination 
97				var _pagination = false;
98				if(settings.pagination){
99					_pagination = {
100						el: $target.parent().find('.swiper-pagination')[0],
101					   type: settings.pagination_type,
102					   clickable: true,
103					  	dynamicBullets: false
104					}
105				}
106				//-- Navigation
107				var _navigation = false;
108				if(settings.navigation){
109					_navigation = {
110						nextEl: $target.parents('.swiper-slider-wrapper').find('.swiper-nav-next')[0],
111				    	prevEl: $target.parents('.swiper-slider-wrapper').find('.swiper-nav-prev')[0],
112				    	hiddenClass: 'hidden'
113					}
114				}
115				console.log($target[0]);
116				var swiper = new Swiper($target[0], {
117				  	loop: settings.loop,
118				  	spaceBetween: 30,
119				  	autoplay: _autoplay,
120				  	speed: settings.speed,
121				  	grabCursor: true,
122				  	breakpoints: {
123				  		0: {
124				  			slidesPerView: 1
125				  		},
126				  		390: {
127					      slidesPerView: settings.items_xx
128					   },
129					   640: {
130					   	slidesPerView: settings.items_xs
131					   },
132					   768: {
133					      slidesPerView: settings.items_sm
134					   },
135					   1024: {
136					      slidesPerView: settings.items_md
137					   },
138					   1200: { // when window width is >= 1200px
139					      slidesPerView: settings.items_lg,
140					   },
141					   1400: { // when window width is >= 1200px
142					      slidesPerView: settings.items,
143					   }
144				  	},
145				  	pagination: _pagination,
146				  	navigation: _navigation,
147				   observer: true,  
148		       	observeParents: true,
149				});
150
151				if(settings.autoplay_hover && settings.autoplay){
152					$target.hover(function() {
153			 			swiper.autoplay.stop();
154					}, function() {
155					   swiper.autoplay.start();
156					});
157				}
158			})
159		},
160
161	 	menuMobile: function(){
162			$('.gva-offcanvas-content ul.gva-mobile-menu > li:has(ul)').addClass("has-sub");
163			$('.gva-offcanvas-content ul.gva-mobile-menu > li:has(ul) > a').after('<span class="caret"></span>');
164			$( document ).on('click', '.gva-offcanvas-content ul.gva-mobile-menu > li > .caret', function(e){
165			  	e.preventDefault();
166			  	var checkElement = $(this).next();
167			  	$('.gva-offcanvas-content ul.gva-mobile-menu > li').removeClass('menu-active');
168			  	$(this).closest('li').addClass('menu-active'); 
169			  
170			  	if((checkElement.is('.submenu-inner')) && (checkElement.is(':visible'))){
171				 	$(this).closest('li').removeClass('menu-active');
172				 	checkElement.slideUp('normal');
173			  	}
174		  		if((checkElement.is('.submenu-inner')) && (!checkElement.is(':visible'))){
175			 		$('.gva-offcanvas-content ul.gva-mobile-menu .submenu-inner:visible').slideUp('normal');
176			 		checkElement.slideDown('normal');
177		  		}
178		  		if (checkElement.is('.submenu-inner')){
179			 		return false;
180		  		} else {
181			 		return true;  
182		  		}   
183			})
184
185			$( document ).on( 'click', '.canvas-menu.gva-offcanvas > a.dropdown-toggle', function(e){
186		  		e.preventDefault();
187		  		var $style = $(this).data('canvas');
188			  	if($('.gva-offcanvas-content' + $style).hasClass('open')){
189				 	$('.gva-offcanvas-content' + $style).removeClass('open');
190				 	$('#gva-overlay').removeClass('open');
191				 	$('#wp-main-content').removeClass('blur');
192			  	}else{
193				 	$('.gva-offcanvas-content' + $style).addClass('open');
194				 	$('#gva-overlay').addClass('open');
195				 	$('#wp-main-content').addClass('blur');
196			  	}
197			});
198
199			$( document ).on( 'click', '#gva-overlay, .top-canvas a.control-close-mm', function(e){
200			  	e.preventDefault();
201			  	$(this).removeClass('open');
202			  	$('#gva-overlay').removeClass('open');
203			  	$('.gva-offcanvas-content').removeClass('open');
204			  	$('#wp-main-content').removeClass('blur');
205			})
206			$( document ).on( 'click', '.close-canvas', function(e) {
207			  	e.preventDefault();
208			  	$('.gva-offcanvas-content').removeClass('open');
209			  	$('#gva-overlay').removeClass('open');
210			  	$('#wp-main-content').removeClass('blur');
211			})
212
213    		if( ('ontouchstart' in window) || (navigator.msMaxTouchPoints > 0) || (navigator.MaxTouchPoints > 0) ) {
214		      var link_id = '';
215		      $('.gva-nav-menu .menu-item > a').on('click', function(e) {
216		        e.preventDefault();
217		        if ($(this).parent().find('.submenu-inner').length == 0) {   
218		          	window.location.href = $(this).attr('href');
219		          	return;
220		        	}
221		        	if ($(this).attr('data-link_id') == link_id) {         
222		          	window.location.href = $(this).attr('href');
223		          	return;
224		        	}
225		        	if($(window).width() < 1024){
226		          	$('.gva-offcanvas-content ul.gva-mobile-menu > li').removeClass('menu-active');
227		          	$('.gva-offcanvas-content ul.gva-mobile-menu .submenu-inner:visible').slideUp('normal');
228		          	$(this).parent().find('> .submenu-inner').slideDown();
229		          	$(this).closest('li').addClass('menu-active');
230		        	}
231		        	link_id = $(this).attr('data-link_id');
232		        	e.preventDefault();
233		        	return;
234		      });
235		   }
236	 	},
237
238	 	postMasonry: function(){
239			var $container = $('.post-masonry-style');
240			$container.imagesLoaded( function(){
241		  		$container.masonry({
242			 		itemSelector : '.item-masory',
243			 		gutterWidth: 0,
244			 		columnWidth: 1,
245		  		}); 
246			});
247	 	},
248
249		scrollTop: function(){
250			var offset = 300;
251			var duration = 500;
252
253			jQuery(window).scroll(function() {
254			  	if (jQuery(this).scrollTop() > offset) {
255				 	jQuery('.return-top').fadeIn(duration);
256			  	} else {
257				 	jQuery('.return-top').fadeOut(duration);
258			  	}
259			});
260
261			$( document ).on('click', '.return-top', function(event){
262			  	event.preventDefault();
263			  	jQuery('html, body').animate({scrollTop: 0}, duration);
264			  	return false;
265			});
266		},
267
268	 	stickyMenu: function(){
269			if( $('.gv-sticky-menu').length > 0 ){
270				$( ".gv-sticky-menu" ).wrap( "<div class='gv-sticky-wrapper'></div>" );
271
272		      var headerHeight = $('.gv-sticky-menu').height();
273		      var menu = $('.gv-sticky-wrapper');
274
275		      $(window).on('scroll', function () {
276		         if ($(window).scrollTop() > menu.offset().top) {
277		            menu.addClass('is-fixed');
278		            menu.css('height', headerHeight);
279		         } else {
280		            menu.removeClass('is-fixed');
281		            menu.css('height', 'auto');
282		         }
283		      });
284		   }
285	 	},
286
287	 	progress_animation: function(){
288	 		$("[data-progress-animation]").each(function() {
289	        var $this = $(this);
290	        $this.appear(function() {
291	          var delay = ($this.attr("data-appear-animation-delay") ? $this.attr("data-appear-animation-delay") : 1);
292	          if(delay > 1) $this.css("animation-delay", delay + "ms");
293	          setTimeout(function() { $this.animate({width: $this.attr("data-progress-animation")}, 800);}, delay);
294	        }, {accX: 0, accY: -50});
295	      });
296	 	},
297
298	 	user: function(){
299	 		$('.user-one__login-account').on('click', function(){
300			  	if($(this).hasClass('open')){
301				 	$(this).removeClass('open');
302			  	}else{
303				 	$(this).addClass('open');
304			  	}
305			})
306	 	},
307
308	 	booking: function(){
309	 		$('.my_account_page_nav_wrapper').mCustomScrollbar();
310			$('#checkout_form_block > *:eq(2), #checkout_form_block > *:eq(3), #checkout_form_block > *:eq(4)').wrapAll('<div class="checkout-information"></div>');
311			$('#checkout_form_block > *:eq(0), #checkout_form_block > *:eq(1)').wrapAll('<div class="checkout-items"></div>');
312	 	},
313
314		other: function(){
315			$('.popup-video').magnificPopup({
316			  	type: 'iframe',
317			  	fixedContentPos: false
318			});
319
320			$( document ).on( 'click', '.yith-wcwl-add-button.show a', function() {
321			  $(this).addClass('loading');
322			});
323
324			$(document).on('click', '.gva-search > a.control-search', function(){
325				let _btn = $(this);
326			  	if(_btn.hasClass('search-open')){
327				 	_btn.parents('.gva-search').removeClass('open');
328				 	_btn.removeClass('search-open');
329			  	}else{
330				 	_btn.parents('.gva-search').addClass('open');
331				 	_btn.addClass('search-open');
332				 	setTimeout(function(){ 
333		            _btn.parent('.main-search').find('.gva-search input.input-search').first().focus(); 
334		         }, 100);
335			  	}
336			});
337
338			$(document).on('click', '.mini-cart-header .mini-cart', function(e){
339				e.preventDefault();
340				$(this).parent('.mini-cart-inner').addClass('open');
341			});
342			$(document).on('click', '.mini-cart-header .minicart-overlay', function(e){
343				e.preventDefault();
344				$(this).parent('.mini-cart-inner').removeClass('open');
345			});
346
347			$('.scroll-link[href*="#"]:not([href="#"])').click(function() {
348		      if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'') && location.hostname == this.hostname) {
349		        var target = $(this.hash);
350		        target = target.length ? target : $('[name=' + this.hash.slice(1) +']');
351		        if (target.length) {
352		          $('html, body').animate({
353		            scrollTop: target.offset().top - 100
354		          }, 1500);
355		          return false;
356		        }
357		      }
358		   });
359
360			$('.gowilds-post-share.style-2 .btn-control-share').on('click', function(e){
361				e.preventDefault();
362				var wrapper = $(this).parents('.gowilds-post-share');
363				if(wrapper.hasClass('open')){
364					wrapper.removeClass('open');
365				}else{
366					wrapper.addClass('open');
367				}
368			});
369
370			$('.gva-portfolio-grid .portfolio-filter').each(function(){
371				$(this).find('.btn-filter').each(function(){
372					let _btn = $(this);
373					let filter = _btn.attr('data-filter');
374					let items = _btn.parents('.gva-portfolio-grid').find('.isotope-items').first();
375					_btn.find('.count').first().html('[' + items.find('> ' + filter).length + ']');
376				});
377			});
378
379			var scrollToTop = function() {
380		      var scrollTo = $('#wp-main-content').offset().top - 100;
381		      $('html, body').stop().animate({
382		         scrollTop: scrollTo
383		      }, 400);
384		   };
385
386		   $('.gva_widget_recent_give .give-block .give__progress-bar, .content-single-give-form .give-progress-information .give__progress-bar').each(function(){
387        		var $progressbar = $(this);
388        		$progressbar.css('width', $progressbar.data('progress-max'));
389      	});
390
391		   if(!$('.gowilds-gva_ba_item_steps').html()){
392      		$('.title-for-step').addClass('hidden');
393      	};
394			if(!$('#block_faqs').length){
395				$('.elementor-widget-babe-item-faqs .babe_post_content_title').addClass('hidden');
396			}
397		}
398	}
399
400	$(window).on('load', function(){
401      $(document).on('click', '.minicart-close', function(e){
402         e.preventDefault();
403         $(this).parents('.cart').removeClass('open');
404      })
405
406		if($('.product-single-inner .flex-control-nav').length){
407			$('.product-single-inner .flex-control-nav').wrap('<div class="swiper-container product-thumbnail-swiper"></div>');
408			$('.product-single-inner .flex-control-nav').after('<div class="swiper-nav-next"></div><div class="swiper-nav-prev"></div>');
409			$('.product-single-inner .flex-control-nav').addClass('swiper-wrapper');
410			$('.product-single-inner .flex-control-nav > li').addClass('swiper-slide');
411			var swiper = new Swiper('.product-single-inner .product-thumbnail-swiper', {
412	        	pagination: '.swiper-pagination',
413	        	slidesPerView: 'auto',
414	        	paginationClickable: true,
415	        	spaceBetween: 10,
416	        	navigation: {
417	        		nextEl: '.swiper-nav-next',
418				   prevEl: '.swiper-nav-prev'
419				},
420	        	breakpoints: {
421			  		0: {
422			  			slidesPerView: 2
423			  		},
424			  		390: {
425				      slidesPerView: 2
426				   },
427				   640: {
428				   	slidesPerView: 3
429				   },
430				   768: {
431				      slidesPerView: 4
432				   },
433				   1024: {
434				      slidesPerView: 4
435				   },
436				   1400: { 
437				      slidesPerView: 4,
438				   }
439			  	}
440	    	});
441		};
442	});
443
444  	$(document).ready(function(){
445	 	GaviasTheme.init();
446  	})
447
448})(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.