PageSourceSearch

https://casa-toedi.ch/themes/default/js/script.js?rev=1.2.1

js casa-toedi.ch collected 2026-10-06 17:50:41 UTC 6,293 bytes, 241 lines download raw bytes

1//Einblenden nach Seitenladen
2$(window).load(function(event) {
3	$("body, .main-nav, #bg-img, footer").animate({opacity: 1}, 500);
4});
5
6$(function() {
7	//Seiten-Wechsel-Fade
8	$("body, .main-nav, #bg-img, footer").css("opacity", 0);
9	$("a:not(.no-fx)").click(function(e) {
10		e.preventDefault();
11		target = this.href;
12		$("body, .main-nav, #bg-img, footer").animate({opacity: 0}, 500, 'swing', function() {
13			window.location = target;
14		});
15	});
16	
17	//Klapp-Menü
18	function toggle_menu(event) {
19		if(menu_shown) {
20			d = -$(".main-nav").outerHeight();
21			e = 'easeInBack';
22			menu_shown = false;
23		} else {
24			d = -50;
25			e = 'easeOutBack';
26			menu_shown = true;
27		}
28		$(".main-nav").animate({top: d}, 800, e);
29	}
30	$(".main-nav").css("top", -$(".main-nav").outerHeight());
31	var menu_shown = false;
32	//Menü Button Klick
33	$(".menu").click(function(event) {
34		toggle_menu(event);
35		event.preventDefault();
36	});
37	//Responsive Menü Höhe
38	$(window).resize(function() {
39		if(!menu_shown) {
40			$(".main-nav").css("top", -$(".main-nav").outerHeight());
41		}
42	});
43	
44	//Scroller: http://areaaperta.com/nicescroll/
45	//if(!Modernizr.touch && !($.browser.msie && parseInt($.browser.version) <= 7)) {
46		//$("html").niceScroll();
47	//}
48	
49	//FancyBox: http://fancyapps.com/fancybox/
50	$(".fancybox")
51	//.attr('rel', 'gallery')
52	.fancybox({
53		nextMethod : 'resizeIn',
54		nextSpeed  : 250,
55		prevMethod : false,
56		minHeight : 30,
57		helpers : {
58			title : {
59				type : 'inside'
60			}
61		}
62	});
63	
64	// News
65	if($(".royalSlider").length > 0) {
66		$(".royalSlider").royalSlider({
67			arrowsNav: true,
68			transitionType: 'move',
69			slidesSpacing: 10,
70			transitionSpeed: 3000,
71			loop: true,
72			autoPlay: {
73				enabled: true,
74				delay: 4000
75			},
76			imageScaleMode: 'fill',
77			autoHeight: true,
78			controlsInside: false
79		});
80		
81		$(".royalSlider").data('royalSlider').ev.on('rsAfterSlideChange', move_footer);
82	}
83	
84	//Footer fixieren
85	$(window).resize(move_footer);
86	$(window).load(move_footer);
87	
88	//Background ein-/ausblenden
89	var bg_shown = false;
90	$("#show-image").click(function(event){
91		if(!bg_shown && menu_shown) {
92			toggle_menu();
93		}
94		if(bg_shown) {
95			r = 0;
96			s = '40px';
97			p = '8px'
98			bg_shown = false;
99		} else {
100			r = 45;
101			s = '38px';
102			p = '9px';
103			bg_shown = true;
104		}
105		$("#bg-trans").fadeToggle(2000);
106		$("#bg-desc").fadeToggle(2000);
107		$("section#content").fadeToggle(2000);
108		$("#show-image img").animateRotate(r, {duration: 2000, extra: {height: s, width: s}});
109		$(".bg-change").animate({padding: p}, 2000, 'swing', move_footer);
110		event.preventDefault();
111	});
112});
113
114//Footer-Funktion
115function move_footer() {
116	if( $("section#main").outerHeight(true) + $("section#main footer").outerHeight(true) > document.documentElement.clientHeight) {
117		$("footer").css("position", "").css("bottom", "");
118	} else {
119		$("footer").css("position", "fixed").css("bottom", "0px");
120	}
121}
122
123//FancyBox Funktion
124(function ($, F) {
125	F.transitions.resizeIn = function() {
126		var previous = F.previous,
127			current  = F.current,
128			startPos = previous.wrap.stop(true).position(),
129			endPos   = $.extend({opacity : 1}, current.pos);
130		startPos.width  = previous.wrap.width();
131		startPos.height = previous.wrap.height();
132		previous.wrap.stop(true).trigger('onReset').remove();
133		delete endPos.position;
134		current.inner.hide();
135		current.wrap.css(startPos).animate(endPos, {
136			duration : current.nextSpeed,
137			easing   : current.nextEasing,
138			step     : F.transitions.step,
139			complete : function() {
140				F._afterZoomIn();
141				current.inner.fadeIn("fast");
142			}
143		});
144	};
145}(jQuery, jQuery.fancybox));
146
147$(function() {
148	// serialize a jquery selection to an object
149	$.fn.serializeObject = function() {
150		var o = {};
151		var a = this.serializeArray();
152		$.each(a, function() {
153			if (o[this.name]) {
154				if (!o[this.name].push) {
155					o[this.name] = [o[this.name]];
156				}
157				o[this.name].push(this.value || '');
158			} else {
159				o[this.name] = this.value || '';
160			}
161		});
162		return o;
163	};
164
165	// compare two Arrays
166	Array.prototype.equals = function(arr2) {
167		if(this.length != arr2.length)
168			return false;
169
170		for (var i = 0; i < this.length; i++) {
171			if(this[i] !== arr2[i])
172				return false;
173		}
174
175		return true;
176	};
177});
178
179function handleFeValidationErrors(failedValidators, $formScope) {
180	$formScope = $formScope || $('form');
181	$formScope.find('.error').remove();
182	$.each(failedValidators, function(fieldName, validators) {
183		// compose error message
184		var errorMsg = '';
185		var singleErrors = [];
186		$.each(validators, function(i, validator) {
187			if (validator.errorMessage != 'null') {
188				singleErrors.push(validator.errorMessage);
189			}
190		});
191		errorMsg = singleErrors.join('<br />');
192
193		// if no error message was added return
194		if (errorMsg.length === 0)
195			return;
196
197		// try to find matching element in form
198		var element = $formScope.find('[name=' + fieldName + ']');
199		element.parent().append('<span class="error">' + errorMsg + '</span>');
200	});
201}
202
203$.fn.animateRotate = function(endAngle, options, startAngle) {
204	return this.each(function() {
205		var elem = $(this), rad, costheta, sintheta, matrixValues, noTransform = !('transform' in this.style || 'webkitTransform' in this.style || 'msTransform' in this.style || 'mozTransform' in this.style || 'oTransform' in this.style),
206			anims = {}, animsEnd = {};
207		if(typeof options !== 'object') {
208			options = {};
209		}
210		else if(typeof options.extra === 'object') {
211			anims = options.extra;
212			animsEnd = options.extra;
213		}
214		anims.deg = startAngle;
215		animsEnd.deg = endAngle;
216		options.step = function(now, fx) {
217			if(fx.prop === 'deg') {
218				if(noTransform) {
219					rad = now * (Math.PI * 2 / 360);
220					costheta = Math.cos(rad);
221					sintheta = Math.sin(rad);
222					//matrixValues = 'M11=' + costheta + ', M12=-'+ sintheta +', M21='+ sintheta +', M22='+ costheta;
223					//$('body').append('Test ' + matrixValues + '<br />');
224					elem.css({
225						'filter': 'progid:DXImageTransform.Microsoft.Matrix(sizingMethod=\'auto expand\','+matrixValues+')',
226						'-ms-filter': 'progid:DXImageTransform.Microsoft.Matrix(sizingMethod=\'auto expand\','+matrixValues+')'
227					});
228				}
229				else {
230					elem.css({ transform: 'rotate('+now+'deg)' });
231				}
232			}
233		};
234		if(startAngle) {
235			$(anims).animate(animsEnd, options);
236		}
237		else {
238			elem.animate(animsEnd, options);
239		}
240	});
241};

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.