PageSourceSearch

https://www.hanneshof-kleinarl.at/js/scripts.js

js hanneshof-kleinarl.at collected 2026-10-09 02:57:03 UTC 16,656 bytes, 503 lines download raw bytes

1/*Adjust Nach Oben BTN*/
2function adjustNachObenBTN()
3{
4	var off = jQuery(window).scrollTop();
5	var btn = jQuery('#no_btn');
6	var vis = jQuery('#no_btn').is(':visible');
7	if(off > 80)
8	{
9		if( vis ) return;
10		jQuery(btn).fadeIn();
11		jQuery(btn).addClass('active');
12		return;
13	}
14	else
15	{
16		if( !vis ) return;
17		jQuery(btn).fadeOut();
18		jQuery(btn).removeClass('active');
19	}
20}
21
22/*
23 * Replace all SVG images with inline SVG
24 */
25function replaceSvg()
26{
27    jQuery('img.svg').each(function(){
28        var $img = jQuery(this);
29        var imgID = $img.attr('id');
30        var imgClass = $img.attr('class');
31        var imgURL = $img.attr('src');
32
33        jQuery.get(imgURL, function(data) {
34            // Get the SVG tag, ignore the rest
35            var $svg = jQuery(data).find('svg');
36
37            // Add replaced image's ID to the new SVG
38            if(typeof imgID !== 'undefined') {
39                $svg = $svg.attr('id', imgID);
40            }
41            // Add replaced image's classes to the new SVG
42            if(typeof imgClass !== 'undefined') {
43                $svg = $svg.attr('class', imgClass+' replaced-svg');
44            }
45
46            // Remove any invalid XML tags as per http://validator.w3.org
47            $svg = $svg.removeAttr('xmlns:a');
48
49            // Replace image with new SVG
50            $img.replaceWith($svg);
51
52        }, 'xml');
53
54    });
55}
56
57function noTranslate(ancestor, words) {
58    for(var i = 0; i < words.length; i++)
59    {
60        var word = words[i];
61        var elements= [];
62        wordCap =  word.replace(/(?:^|\s)\S/g, function(a) { return a.toUpperCase(); });
63        var regex = new RegExp("("+word+"|"+word.toUpperCase()+"|"+wordCap+")", 'g');
64        walk(ancestor);
65    }
66    return elements;
67
68    function walk(element) {
69        var n= element.childNodes.length;
70        if($(element).hasClass('notranslate')) return;
71        for (var i= 0; i < element.childNodes.length; i++) {
72            var child= element.childNodes[i];
73            result = regex.exec(child.data);
74            if (child.nodeType===3 && (result !== null)) {
75                //Check if word is substring of another word, in this case we do nothing
76                var matchWord = result[1];
77                var charBefore, charAfter;
78                (child.data.indexOf(matchWord) > 0) ? charBefore = child.data.charAt(child.data.indexOf(matchWord) - 1) : charBefore = null;
79                (child.data.length > child.data.indexOf(matchWord) + matchWord.length) ? charAfter = child.data.charAt(child.data.indexOf(matchWord) + matchWord.length) : charAfter = null;
80                if(isLetter(charBefore) || isLetter(charAfter)) continue;
81                //Split Text and creat new element
82                var split = child.data.split(matchWord);
83                var insertedChild;
84
85                if(split[0] != "")
86                {
87                    var newElem = document.createTextNode(split[0]);
88                    insertedChild = child.parentNode.replaceChild(newElem, child);
89                    insertedChild = newElem;
90                    var newElem = document.createElement("var");
91                    newElem.innerText = ' '+matchWord+' ';
92                    newElem.className = 'notranslate';
93                    insertAfter(newElem,insertedChild);
94                    insertedChild = newElem;
95                }
96                else
97                {
98                    var newElem = document.createElement("var");
99                    newElem.innerText = ' '+matchWord+' ';
100                    newElem.className = 'notranslate';
101                    child.parentNode.replaceChild(newElem, child);
102                    insertedChild = newElem;
103                }
104
105                for(var j = 1; j < split.length; j++)
106                {
107                    if(split[j] != "")
108                    {
109                        var newElem = document.createTextNode(split[j]);
110                        insertAfter(newElem, insertedChild);
111                        insertedChild = newElem;
112                    }
113                    if(j < split.length - 1)
114                    {
115                        var newElem = document.createElement("var");
116                        newElem.innerText = ' '+matchWord+' ';
117                        newElem.className = 'notranslate';
118                        insertAfter(newElem,insertedChild);
119                        insertedChild = newElem;
120                    }
121                }
122            }
123        }
124        for (var i= 0; i<element.childNodes.length; i++) {
125            var child= element.childNodes[i];
126            if (child.nodeType===1)
127                walk(child);
128        }
129    }
130
131    function isLetter(c) {
132        if(typeof c == "undefined" || c == null) return false;
133        return c.toLowerCase() != c.toUpperCase();
134    }
135
136    function insertAfter(newElement,targetElement) {
137        // target is what you want it to go after. Look for this elements parent.
138        var parent = targetElement.parentNode;
139        // if the parents lastchild is the targetElement...
140        if (parent.lastChild == targetElement) {
141            // add the newElement after the target element.
142            parent.appendChild(newElement);
143        } else {
144            // else the target has siblings, insert the new element between the target and it's next sibling.
145            parent.insertBefore(newElement, targetElement.nextSibling);
146        }
147    }
148}
149
150var mytablegen = function(table)
151{
152    var e = $(table);
153    e.addClass("hide_on_mobile");
154    var t = e.find("thead th"),
155        r = e.find("tbody tr").clone(),
156        n = e.attr("class");
157    "" != n && (n += " ");
158    var i = "",
159        a = ["cellpadding", "cellspacing"];
160    for (var s in a) jQuery(e).hasAttr(a[s]) && (i += a[s] + "=" + jQuery(e).attr(a[s]) + " ");
161    var l = $('<table class="' + n + ' mobile_table"' + i + "><tbody></tbody></table>").removeClass("hide_on_mobile"),
162        o = l.find("tbody");
163    r.each(function(e) {
164        var r = $(this).find("td"),
165            n = "odd";
166        r.each(function(e) {
167            n = "odd" == n ? "even" : "odd";
168            var r = $('<tr class="' + n + '"></tr>').appendTo(o);
169            0 != e ? (r.append(jQuery(t.clone().get(e)).attr("width", "60%")), r.append($(this).attr("width", "40%"))) : r.append($(this).attr("colspan", "2").addClass("trtitle"))
170        })
171    }), $(table).after(l)
172}
173
174/*Desktop Navi open submenu on first click by tablet representation*/
175;(function( $, window, document, undefined )
176{
177	$.fn.doubleTapToGo = function( params )
178	{
179		if( !( 'ontouchstart' in window ) &&
180			!navigator.msMaxTouchPoints &&
181			!navigator.userAgent.toLowerCase().match( /windows phone os 7/i ) ) return false;
182
183		this.each( function()
184		{
185			var curItem = false;
186
187			$( this ).on( 'click', function( e )
188			{
189				var item = $( this );
190				if( item[ 0 ] != curItem[ 0 ] )
191				{
192					e.preventDefault();
193					curItem = item;
194				}
195			});
196
197			$( document ).on( 'click touchstart MSPointerDown', function( e )
198			{
199				var resetItem = true,
200					parents	  = $( e.target ).parents();
201
202				for( var i = 0; i < parents.length; i++ )
203					if( parents[ i ] == curItem[ 0 ] )
204						resetItem = false;
205
206				if( resetItem )
207					curItem = false;
208			});
209		});
210		return this;
211	};
212})( jQuery, window, document );
213
214var preloadFadeOut = false;
215function headerImagePreload($preloader, $headerImageC)
216{
217    if($preloader.length < 1 || $headerImageC.length < 1) return;
218
219    var $img = $headerImageC.find('img');
220    if($img.length < 1 ) return;
221
222    $img.first().on('load', function(){
223        if(!preloadFadeOut)
224        {
225            $preloader.fadeOut(750, "swing");
226            preloadFadeOut = true;
227
228            $('body').find('.h_sidebar .h_sidebar_btn').addClass('bounceInLeft');
229            $('body').find('.h_slogan_c > *').addClass('fadeInUp');
230            $('body').find('.h_infobox_c').addClass('bounceInRight');
231			$('body').find('.h_infobox_c2').addClass('bounceInRight');
232        }
233    //Load event do not trigger by the cached images
234    }).each(function() {
235        if(this.complete) $(this).trigger('load');
236    });
237}
238
239//Preloader Screen
240jQuery(document).ready(function(){
241    var $preloader = jQuery('#preloader');
242    var $headerImageC = jQuery('body').find('.header_image');
243
244    headerImagePreload($preloader, $headerImageC);
245});
246
247jQuery(document).ready(function(){
248
249    /*Desktop Navi*/
250    var $deskMenu = $("#deskmenu");
251    var $deskMenuBtn = $("#desktop_menu_btn");
252    var $mobileMenu = $("#mobile_menu_layer");
253   $deskMenu.find(".menu_inner > ul > li:first-child a").focus(function() {
254		$deskMenu.addClass("opened");
255        $deskMenuBtn.addClass("opened");
256        $deskMenu.find('.menu_btn_c a').removeClass('bounceOutRight').addClass('bounceInRight');
257	});
258
259    $deskMenu.find(".menu_inner li:last-child ul li:last-child a").blur(function() {
260		$deskMenu.removeClass("opened");
261        $deskMenuBtn.removeClass("opened");
262        $deskMenu.find('.menu_btn_c a').removeClass('bounceInRight').addClass('bounceOutRight');
263	});
264
265
266	$deskMenuBtn.click(function()
267    {
268        $deskMenu.toggleClass("opened");
269        $deskMenuBtn.toggleClass("opened");
270        $mobileMenu.toggleClass("opened");
271        menu_adjustInnerContainer();
272
273        if($deskMenu.hasClass("opened"))
274            $deskMenu.find('.menu_btn_c a').removeClass('bounceOutRight').addClass('bounceInRight');
275        else
276            $deskMenu.find('.menu_btn_c a').removeClass('bounceInRight').addClass('bounceOutRight');
277
278    });
279
280    replaceSvg();
281    jQuery('body').find('.h_infobox_close_btn').click(function(e)
282    {
283        var $infoBox = jQuery(e.target).closest('.h_infobox_c');
284        $infoBox.removeClass('bounceInRight bounceInRightInfobox').addClass('bounceOutRightInfobox');
285        $infoBox.find('.h_infobox_logo').removeClass('bounceInRightInfoboxBtn').addClass('bounceOutRightInfoboxBtn');
286    });
287	jQuery('body').find('.h_infobox_close_btn').click(function(e)
288    {
289        var $infoBox = jQuery(e.target).closest('.h_infobox_c2');
290        $infoBox.removeClass('bounceInRight bounceInRightInfobox').addClass('bounceOutRightInfobox');
291        $infoBox.find('.h_infobox_logo').removeClass('bounceInRightInfoboxBtn').addClass('bounceOutRightInfoboxBtn');
292    });
293
294    jQuery('body').find('.h_infobox_logo').click(function(e)
295    {
296        e.preventDefault();
297        e.stopPropagation();
298        var $infoBox = jQuery(e.target).closest('.h_infobox_c');
299        if($infoBox.hasClass('bounceOutRight') || $infoBox.hasClass('bounceOutRightInfobox'))
300        {
301            $infoBox.removeClass('bounceOutRight bounceOutRightInfobox').addClass('bounceInRightInfobox');
302            jQuery(e.target).removeClass('bounceOutRightInfoboxBtn').addClass('bounceInRightInfoboxBtn');
303        }
304    });
305	 jQuery('body').find('.h_infobox_logo').click(function(e)
306    {
307        e.preventDefault();
308        e.stopPropagation();
309        var $infoBox = jQuery(e.target).closest('.h_infobox_c2');
310        if($infoBox.hasClass('bounceOutRight') || $infoBox.hasClass('bounceOutRightInfobox'))
311        {
312            $infoBox.removeClass('bounceOutRight bounceOutRightInfobox').addClass('bounceInRightInfobox');
313            jQuery(e.target).removeClass('bounceOutRightInfoboxBtn').addClass('bounceInRightInfoboxBtn');
314        }
315    });
316
317    //jQuery('#mobile_menu_btn').click( function() {menuSlideC(jQuery(this), jQuery('#menu_slide_c'));});
318
319
320    /*Nach Oben BTN*/
321	//jQuery('#no_btn').click( function(){jQuery('html, body').animate({ 'scrollTop': 0 }, "normal", "easeInQuart");});
322	//adjustNachObenBTN();
323
324    //No translate function call
325    //noTranslate(document.getElementsByClassName('page_c')[0],noTranlateWords);
326
327
328	/*
329		// For fullscreen header image define the proportion of the image
330		window['bg_img_w'] = 2000;
331		window['bg_img_h'] = 1225;
332	*/
333
334    //Sidebar
335    $sidebar = $('.h_sidebar');
336    $sidebar.find(".h_sidebar_link_c a:first-child").focus(function() {
337		$sidebar.addClass("opened");
338	});
339
340    $sidebar.find(".sidebar_badge").blur(function() {
341		$sidebar.removeClass("opened");
342	});
343
344    //Animate Box Column Elements
345    var $columnContainer = $('body').find('.art_element.art_group.columns');
346
347    if(typeof $columnContainer.gridalicious == "function")
348    {
349        $columnContainer.find("> .art_element_c > .art_inner").gridalicious({
350            gutter: 25,
351            width: 290,
352            selector: '.art_element',
353            animate: true,
354            animationOptions: {
355                queue: true,
356                speed: 200,
357                duration: 200,
358                },
359        });
360
361        $columnContainer.find('.art_element').css('opacity','0');
362
363        $columnContainer.each(function()
364        {
365            $(this).viewportChecker({
366                classToAdd: 'visible', // Class to add to the elements when they are visible
367                offset: 60,
368                callbackFunction: function(elem, action){
369                    var $inner = $(elem).find("> .art_element_c > .art_inner");
370
371                    if($inner.length < 1) return;
372                    //Show Boxes
373                    $inner.data('gridalicious').render();
374                }
375            });
376        });
377    }
378
379
380
381
382
383    //Counter
384	jQuery('.zahl').viewportChecker({
385        classToAdd: 'count', // Class to add to the elements when they are visible
386        offset: 60,
387        callbackFunction: function(elem, action){
388        $(elem).prop('Counter',0).animate({
389        	Counter: $(elem).text()
390        }, {
391        	duration: 3000,
392        	easing: 'swing',
393        	step: function (now) {
394        		$(elem).text(Math.ceil(now));
395        	}
396        });
397        }
398    });
399
400    jQuery('.zahl_float').viewportChecker({
401        classToAdd: 'count', // Class to add to the elements when they are visible
402        offset: 60,
403        callbackFunction: function(elem, action){
404        $(elem).prop('Counter',0).animate({
405        	Counter: $(elem).text()
406        }, {
407        	duration: 3000,
408        	easing: 'swing',
409        	step: function (now) {
410        		$(elem).text(now.toFixed(3));
411        	}
412        });
413        }
414    });
415
416    // Anfrage Sichtbarkeit
417    $(window).scroll(function() {
418        var scroll = $(window).scrollTop();
419        if (scroll >= 120) {
420    		  $('.anfrage_c').addClass('visible');
421    	}
422    	if (scroll <= 120) {
423    		  $('.anfrage_c').removeClass('visible');
424    	}
425    });
426
427    // Header image autoslide time
428    window['header_image_slider_config'] = {
429            dots: true,
430            arrows:false,
431            animationSpeed: 700,
432            autoplay:true,
433            autoplaySpeed: 5000,
434        };
435    initHeaderImage();
436});
437
438// Gallery desktop slider
439//window['art_gal_slider_time'] = 2000; // Interval for sliding
440//window['art_gal_slider_animation_speed'] = 100;
441//Header Image Init
442
443
444// Package slider config
445window['art_package_slider_config'] = {
446    dots: true,
447    arrows: true,
448    slidesToShow: 3,
449    speed: 600,
450    autoplay: true,
451    autoplaySpeed: 5000,
452    tablet_breakpoint: 1025,
453    tablet_slidesToShow: 2,
454    mobile_breakpoint: 650,
455    mobile_slidesToShow: 1
456};
457
458// Imageline Slider config
459window['art_imageline_slider_config'] = {
460    dots: false,
461    arrows: true,
462    speed: 600,
463    autoplay: false,
464    autoplaySpeed: 5000,
465    mobile_breakpoint: 650
466};
467
468// Anything Slider config
469window['art_anything_slider_config'] = {
470    isSlider: true,
471    slidesToShow: 3,
472    dots: false,
473	infinite:false,
474	
475	
476    arrows: true,
477    speed: 600,
478    autoplay: true,
479    autoplaySpeed: 5000,
480    adaptiveHeight: true,
481    tablet_breakpoint: 1025,
482    tablet_isSlider: true,
483    tablet_slidesToShow: 3,
484    mobile_breakpoint: 650,
485    mobile_isSlider: true,
486    mobile_slidesToShow: 1
487};
488
489// Mobile tables
490jQuery(document).ready(function(){
491	generate_mobile_table(mytablegen);
492	// generate_mobile_table();
493});
494
495// Enable role button accessibility support
496window['_resp_role_link_support'] = true;
497window['_resp_role_button_support'] = true;
498
499// Accordion offset
500// window['accord_offset'] = ['desktop', 'tablet', 'mobile'];
501
502//Google translate - no translate words
503//noTranlateWords = ['first-word','second-word'];

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.