1"use strict"; 2 3/* 4 * Doc Ready 5 */ 6 7// ScrollRevealer 8 9AOS.init({ 10 offset: 150, 11 duration: 900, 12 easing: 'ease-out', 13 delay: 100, 14 once: true 15}); 16 17jQuery(document).ready(function () { 18 19 $ = jQuery; 20 21 /* ---------------------------------- * 22 | Sticky Header 23 /* ---------------------------------- */ 24 25 $(window).on("scroll", function () { 26 27 if ($("body").hasClass("forceFixed")) return; 28 29 var top = $(window).scrollTop(); 30 31 if (top > 10) { 32 $("body").addClass("fixed"); 33 } else { 34 $("body").removeClass("fixed"); 35 } 36 }); 37 38 /* ---------------------------------- * 39 | Scroll to Anchor 40 /* ---------------------------------- */ 41 42 $(".scrollDown").on("click", function () { 43 44 var to = $(this).attr('data-anchor'); 45 var offset = $(to).offset().top - 65; // - Navi Height 46 47 $("html, body").animate({ scrollTop: offset }, 600); 48 }); 49 50 /* ---------------------------------- * 51 | Navi Toggle 52 /* ---------------------------------- */ 53 54 $("#menu-trigger").on("click", function () { 55 if ($("body").hasClass('navShow')) { 56 $("body").removeClass("navShow"); 57 $('#menu_overlay ul.sub-menu').hide(); 58 $('#menu_overlay .expanded').removeClass('expanded'); 59 $(this).removeClass('close'); 60 $(this).attr('aria-expanded', 'false').attr('aria-label', 'Menü öffnen'); 61 } else { 62 $("body").addClass("navShow"); 63 $("body").addClass("fixed"); 64 $(this).addClass('close'); 65 $("#main_header").addClass('header-bg'); 66 $(this).attr('aria-expanded', 'true').attr('aria-label', 'Menü schlieÃen'); 67 } 68 }); 69 70 $("#menu_overlay a").on("click", function (e) { 71 // Submenu link 72 if ($(this).parent('li').hasClass('menu-item-has-children')) { 73 //falls Menüpunkt schon offen ist, wieder einklappen 74 if ($(this).hasClass('expanded')) { 75 e.preventDefault(); 76 $(this).removeClass('expanded'); 77 $('#menu_overlay ul.sub-menu').slideUp(); 78 return; 79 } 80 //ansonsten Menüpunkt ausklappen 81 else { 82 e.preventDefault(); 83 $(this).addClass('expanded'); 84 $('#menu_overlay ul.sub-menu').slideUp(); 85 $(this).parents('li').find('ul.sub-menu').stop().slideDown(); 86 return; 87 } 88 } 89 }); 90 91 /* ---------------------------------- * 92 | Close Menu with ESC 93 /* ---------------------------------- */ 94 95 $(document).on("keydown", function (e) { 96 // ESC key 97 if (e.key === "Escape" || e.keyCode === 27) { 98 if ($("body").hasClass('navShow')) { 99 $("#menu-trigger").trigger("click"); 100 } 101 } 102 }); 103 104 /* ---------------------------------- * 105 | Responsive 106 /* ---------------------------------- */ 107 108 // Seite nach Window-Resize neu berechnen 109 var fenster_w = $(window).width(); 110 var resize_timer; 111 112 $(window).resize(function () { 113 clearTimeout(resize_timer); 114 resize_timer = setTimeout(function () { 115 var window_changed = $(window).width() != fenster_w; 116 if (window_changed) { 117 $.calculatePage(function () {}); 118 } 119 }, 100); 120 }); 121 122 // Enquire führt Aktionen bei Media-Query-Breakpoints aus 123 enquire.register("screen and (max-width: 600px)", { 124 match: function match() {}, 125 unmatch: function unmatch() {} 126 }); 127 128 // Initial Page Load 129 $.calculatePage(function () { 130 131 // Show calculated Page 132 $("#pagewrapper").css("opacity", 1); 133 }); 134 135 /* 136 * Replace all SVG images with inline SVG 137 */ 138 139 $('img.svg').each(function () { 140 141 var $img = jQuery(this); 142 143 var imgURL = $img.attr('src'); 144 145 jQuery.get(imgURL, function (data) { 146 // Get the SVG tag, ignore the rest 147 var $svg = jQuery(data).find('svg'); 148 149 $.each($img[0].attributes, function () { 150 if (this.specified) { 151 $svg.attr(this.name, this.value); 152 } 153 }); 154
155 // Remove any invalid XML tags as per http://validator.w3.org 156 $svg = $svg.removeAttr('xmlns:a'); 157 158 // Check if the viewport is set, if the viewport is not set the SVG wont't scale. 159 if (!$svg.attr('viewBox') && $svg.attr('height') && $svg.attr('width')) { 160 $svg.attr('viewBox', '0 0 ' + $svg.attr('height') + ' ' + $svg.attr('width')); 161 } 162 163 // Replace image with new SVG 164 $img.replaceWith($svg); 165 }, 'xml'); 166 }); 167}); 168 169/* ---- CALCULATE RESPONSIVE PAGE ELEMENTS ----- */ 170 171jQuery.extend({ 172 173 calculatePage: function calculatePage(callbackFnk) { 174 $ = jQuery; 175 176 // Fire Callback 177 if (typeof callbackFnk == 'function') { 178 callbackFnk.call(this); 179 } 180 } 181 182});
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.