PageSourceSearch

https://www.confiserie-weibler.de/files/layout/action.js?v=f77a2741

js confiserie-weibler.de collected 2026-10-06 14:12:02 UTC 5,567 bytes, 171 lines download raw bytes

1var urlHash = window.location.hash,
2	offsetScroll = 100;
3
4function toHash(hash){
5	if ($('#' + hash).length) {
6		mypos = $('#' + hash).offset().top - offsetScroll;
7		$('html,body').animate({scrollTop:mypos}, 'slow');
8	}else if ($('#sortiment_' + hash).length) {
9		mypos = $('#sortiment_' + hash).offset().top - offsetScroll;
10		$('html,body').animate({scrollTop:mypos}, 'slow');
11		setTimeout(function(){
12			$('#sortiment_' + hash).find("li.filter").eq(0).trigger("click");
13		}, 1000);
14	}else{
15		if (hash.includes('_')) {
16			var firstPart = hash.split('_')[0];
17			var lastPart = hash.split('_')[1];
18			if ($('#sortiment_' + firstPart).length) {
19				mypos = $('#sortiment_' + firstPart).offset().top - offsetScroll;
20				$('html,body').animate({scrollTop:mypos}, 'slow');
21				setTimeout(function(){
22					$('#sortiment_' + firstPart).find("li.filter[data-cat="+lastPart+"]").trigger("click");
23				}, 1000);
24			}
25		}
26	}
27}
28
29$(document).ready(function() {
30	
31	if($(".ce_form .error").length>0){
32		toHash('formular_kontakt');
33	}
34	
35	$(document).on("click", "#pageup", function(e){
36		e.preventDefault();
37		$('html,body').animate({scrollTop:0}, 'slow');
38	});
39	
40	var hash = window.location.hash.substring(1);
41	if (hash) {
42		toHash(hash);
43	}
44	
45	$(document).on("click", 'a[href*="#"]', function(e){
46		var urlHash = $(this).attr("href").split('#')[1];
47		toHash(urlHash);
48	});
49
50	$(document).on("click", "#menu", function(e){
51		e.preventDefault();
52		$("html").toggleClass("menu_open");
53	});
54		
55	$('.widget-select select.select_kundenart').on('change', function() {
56		if ($(this).val() === 'Endverbraucher') {
57			$('.hinweis_endverbraucher').slideDown();
58		} else {
59			$('.hinweis_endverbraucher').slideUp();
60		}
61	});
62	
63	$(document).on("click", ".btn_alle_anzeigen,.sortiment ul.nav li.icon", function(e){
64		e.preventDefault();
65		$(this).closest(".sortiment").find("ul.nav").children("li").eq(1).trigger("click");
66	});
67
68	$(document).on("click", ".module-product-listing .sortiment:not(.in-animation) ul.nav li.filter", function(e){
69		e.preventDefault();
70		var sortiment = $(this).closest('.sortiment'),
71			cat = $(this).data("cat");
72		sortiment.addClass("in-animation");
73
74		if($(this).hasClass("active")){
75			$(".module-product-listing ul.nav li").removeClass("active");
76			$(".module-product-listing .sortiment").children("ul.content").slideUp(function(){
77				$(".module-product-listing ul.content li").hide().removeClass("active");
78					$(".module-product-listing .sortiment").removeClass("in-animation");
79			});
80		}else{
81			$(".module-product-listing ul.nav li").removeClass("active");
82			$(this).addClass("active");
83			sortiment.children("ul.content").slideUp(function(){
84				$(".module-product-listing ul.content li").hide().removeClass("active");
85				sortiment.children("ul.content").children("li.cat_" + cat).show().addClass("active");
86				sortiment.children("ul.content").slideDown(function(){
87					$(".module-product-listing .sortiment").removeClass("in-animation");
88				});
89			});
90		}
91
92	});
93	
94	$(document).on("click", ".produkt_detail .thumbs:not(.in-animation) .thumb", function(e){
95		e.preventDefault();
96		$(".produkt_detail .thumbs").addClass("in-animation");
97		$(".produkt_detail .thumbs .thumb").removeClass("active");
98		$(this).addClass("active");
99		var next = $(this).index();
100		$(".produkt_detail .slides .active img").fadeOut(function(){
101			$(".produkt_detail .slides .active").removeClass("active").find("img").fadeOut();
102			$(".produkt_detail .slides").children().eq(next).find("img").fadeIn(function(){
103				$(".produkt_detail .slides").children().eq(next).addClass("active");
104				$(".produkt_detail .thumbs").removeClass("in-animation");
105			});
106		});
107	});
108	
109	$(document).on("click", ".produkt_detail .prev", function(e){
110		e.preventDefault();
111		var thumbs = $(".produkt_detail .thumbs .thumb").length;
112		var thumb_current = $(".produkt_detail .thumbs .thumb.active").index() - 1;
113		if(thumb_current<0){thumb_current=thumbs - 1;}
114		$(".produkt_detail .thumbs .thumb").eq(thumb_current).trigger("click");
115	});
116	
117	$(document).on("click", ".produkt_detail .next", function(e){
118		e.preventDefault();
119		var thumbs = $(".produkt_detail .thumbs .thumb").length;
120		var thumb_current = $(".produkt_detail .thumbs .thumb.active").index() + 1;
121		if(thumb_current>=thumbs){thumb_current=0;}
122		$(".produkt_detail .thumbs .thumb").eq(thumb_current).trigger("click");
123	});
124
125});//ready
126
127var the_timer_scroll = '',
128	oldScroll = 0,
129	scrollUp = false;
130
131var	ScrollPosMax = function (){
132	posY = jQuery(window).scrollTop();
133	maxY = jQuery('body').height();
134	return Math.min(Math.max(0, posY), maxY);
135};
136
137$(window).on('scroll', function() {
138
139	curScroll = Math.round(ScrollPosMax());
140	scrollDiff = curScroll - oldScroll;
141	if(scrollDiff<0){scrollDiff = scrollDiff * -1;}
142
143	if(curScroll>=oldScroll){scrollUp = false;}else{scrollUp = true;}
144	oldScroll = curScroll;
145
146	if(curScroll>200){
147		$("html").addClass("scrolled_down");
148		if(curScroll>800){
149			$("html").addClass("scrolled_down_long");
150		}else{
151			$("html").removeClass("scrolled_down_long");
152		}
153	}else{
154		$("html").removeClass("scrolled_down scrolled_down_long");
155	}
156
157	if(curScroll>800){
158		$("html").addClass("scroll_sideflag");
159	}else{
160		$("html").removeClass("scroll_sideflag");
161	}
162
163});
164
165jQuery.fn.isInViewportOffset = function() {
166	var elementTop = jQuery(this).offset().top ;
167	var elementBottom = elementTop + jQuery(this).outerHeight();
168	var viewportTop = jQuery(window).scrollTop();
169	var viewportBottom = viewportTop + jQuery(window).height();
170	return (elementBottom - 140) > viewportTop && (elementTop + 100) < viewportBottom;
171};

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.