1 2 3// ======================= 4// ====== Position der Top Bar checken und shrink attribut hinzufügen 5// ======================= 6 7function checkShrinkClass(position) { 8 // Ab position 100 shrink attribut hinzufügren 9 if (position > 100) { 10 $("#header").addClass("shrink"); 11 $(".tccMobileNavButton").addClass("shrink"); 12 } else { 13 $("#header").removeClass("shrink"); 14 $(".tccMobileNavButton").removeClass("shrink"); 15 } 16} 17 18// Scrollverhalten prüfen 19$(document).on("scroll", function() { 20 checkShrinkClass ($(document).scrollTop()); 21}); 22// initial auch ausführen um zu prüfen wo die postion ist 23$(document).ready(function() { 24 checkShrinkClass ($(document).scrollTop()); 25}); 26 27 28 29 30 31// store the hash (DON'T put this code inside the $() function, it has to be executed 32// right away before the browser can start scrolling! 33var target = window.location.hash, 34 target = target.replace('#', ''); 35 36 37// delete hash so the page won't scroll to it 38window.location.hash = ""; 39 40// now whenever you are ready do whatever you want 41// (in this case I use jQuery to scroll to the tag after the page has loaded) 42$(window).on('load', function () { 43 if (target) { 44 $('html, body').animate({ 45 scrollTop: $("#" + target).offset().top 46 }, 700, 'swing', function () {}); 47 } 48}); 49 50 51 52 53 54/* Scrollto */ 55$(document).ready(function(){ 56 57 58 59 // Neues Element von 60 // https://stackoverflow.com/questions/8579643/how-to-scroll-up-or-down-the-page-to-an-anchor-using-jquery 61 // TCC Anmerkung: 62 // wir ziehen etwas ab damit die nav bar nichts verdeckt 63 64 var offset = 64; // Wie viel Abstand soll zur Top Bar eingehalten werden 65 var speed = 500; // Geschwindigkeit in MS 66 67 $("a.tccScrollTo").click(function(e) { 68 //e.preventDefault(); 69 console.log("tccSrollTo1"); 70 71 var aid = $(this).attr("href"); 72 let linkStrings = aid.split('#'); 73 // Hier der Pad der Seite gespeichert 74 let seite = '/'+linkStrings[0]; 75 // Hier wird die CSSID gespeichert zu der gescrollt wird 76 let elementToScrollId = '#'+linkStrings[1]; 77 78 79 80 // Wenn ein Pfad zu einer Seite angegeben ist 81 if (seite !="/"){ 82 // Wenn der aktuele Pfad nicht mit dem Pfad der Seite übereinstimmt 83 if (window.location.pathname != seite){ 84 // Dann soll nichts getan werden und die Standard Weiterleitung wird ausgeführt 85 }else{ 86 // Das Default Verhalten wird blockiert 87 e.preventDefault(); 88 if(elementToScrollId == "#DOWN"){ 89 // Es wird eine Bildschirmhöhe nach unten gescrollt 90 $('html,body').animate({scrollTop: document.documentElement.clientHeight - offset},speed); 91 }else if (elementToScrollId == "#UP"){ 92 // Es wird bis ganz nach oben gescrollt 93 $('html,body').animate({scrollTop: 0 },speed); 94 }else{ 95 // Es wird zum Element gescrollt 96 $('html,body').animate({scrollTop: $(elementToScrollId).offset().top - offset},speed); 97 } 98 } 99 }else { 100 // Das Default Verhalten wird blockiert 101 e.preventDefault(); 102 if(elementToScrollId == "#DOWN"){ 103 // Es wird eine Bildschirmhöhe nach unten gescrollt 104 $('html,body').animate({scrollTop: document.documentElement.clientHeight - offset},speed); 105 }else if (elementToScrollId == "#UP"){ 106 // Es wird bis ganz nach oben gescrollt 107 $('html,body').animate({scrollTop: 0 },speed); 108 }else{ 109 // Es wird zum Element gescrollt 110 $('html,body').animate({scrollTop: $(elementToScrollId).offset().top - offset},speed); 111 } 112 } 113 }); 114 115 116 $(".tccScrollTo a").click(function(e) { 117 /** 118 * Da es auch sein kann, dass es mehrere a Tags innerhalb eines Elements gibt, 119 * überprüfen wir hier ob sich im Attribut "href" ein Id Selektor befindet. 120 * Damit die anderen Links noch wie gewohnt funktionieren können. 121 */ 122 if ($(this).attr("href").includes('#')){ 123 e.preventDefault(); 124 console.log("tccSrollTo2"); 125 126 var aid = $(this).attr("href"); 127 let linkStrings = aid.split('#'); 128 let seite = '/'+linkStrings[0]; 129 let elementToScrollId = '#'+linkStrings[1]; 130 131 // Wenn ein Pfad zu einer Seite angegeben ist 132 if (seite !="/"){ 133 // Wenn der aktuele Pfad nicht mit dem Pfad der Seite übereinstimmt 134 if (window.location.pathname != seite){ 135 // Dann soll nichts getan werden und die Standard Weiterleitung wird ausgeführt 136 }else{ 137 // Das Default Verhalten wird blockiert 138 e.preventDefault(); 139 if(elementToScrollId == "#DOWN"){ 140 // Es wird eine Bildschirmhöhe nach unten gescrollt 141 $('html,body').animate({scrollTop: document.documentElement.clientHeight - offset},speed); 142 }else if (elementToScrollId == "#UP"){ 143 // Es wird bis ganz nach oben gescrollt 144 $('html,body').animate({scrollTop: 0 },speed); 145 }else{ 146 // Es wird zum Element gescrollt 147 $('html,body').animate({scrollTop: $(elementToScrollId).offset().top - offset},speed); 148 } 149 } 150 }else { 151 // Das Default Verhalten wird blockiert 152 e.preventDefault(); 153 if(elementToScrollId == "#DOWN"){ 154 // Es wird eine Bildschirmhöhe nach unten gescrollt 155 $('html,body').animate({scrollTop: document.documentElement.clientHeight - offset},speed); 156 } else if (elementToScrollId == "#UP"){ 157 // Es wird bis ganz nach oben gescrollt 158 $('html,body').animate({scrollTop: 0},speed); 159 } else{ 160 // Es wird zum Element gescrollt 161 $('html,body').animate({scrollTop: $(elementToScrollId).offset().top - offset},speed); 162 } 163 } 164 } 165 }); 166}); 167 168 169// Navigationspunkte müssen wir verzögern 170$('.mainNavOverlay .mod_navigation a').click(function(e) { 171 // Zuerst Link blockieren 172 e.preventDefault(); 173 // wir blenden unseren Fake Container ein 174 $('.loeaderContainerEmpty').addClass('show'); 175 176 177 178 179 // Navigation "zurückbauen"
180 collapseNav(); 181 // Attr specihern und mit delay dann starten 182 href = $(this).attr('href'); 183 setTimeout(function() {window.location = href}, 200); 184 185 186}); 187 188 189// klassen um die Navigation auszubelenden 190function showNav() { 191 // Hauptcontainer einblenden 192 $('.mainNavOverlay').addClass('display-block'); 193 //$('.mainNavOverlay').toggleClass('active'); 194 window.setTimeout(function(){$(".mainNavOverlay").toggleClass("active");}, 20); 195 // Map Container rein fahren 196 window.setTimeout(function(){$(".mainNavOverlay .overLeftContainer").addClass("start");}, 20); 197 window.setTimeout(function(){$(".mainNavOverlay .mod_navigation").addClass("start");}, 200); 198 window.setTimeout(function(){$(".mainNavOverlay .overRightContainer").addClass("start");}, 100); 199 200 $('#mainNavOverlay .mod_navigation ul.level_2').hide(); 201} 202 203 204 205$(".mainNavOverlay .subNavIcon").click(function() { 206 $(this).parent().parent().toggleClass('activeNav'); 207}); 208 209 210 211 212 213 214// klassen um die Navigation auszubelenden 215function collapseNav() { 216 $('.mainNavOverlay .overLeftContainer').removeClass('start'); 217 $('.mainNavOverlay .mod_navigation').removeClass('start'); 218 $('.mainNavOverlay .overRightContainer').removeClass('start'); 219 // navigation schlieÃen aber mit verzögerung 220 window.setTimeout(function(){$(".mainNavOverlay").removeClass("active");}, 800); 221 window.setTimeout(function(){$(".mainNavOverlay").removeClass("display-block");}, 800); 222 $('#tccBurgerMenu').toggleClass('is-active'); 223} 224 225 226// Mobile Navigation öffnen und schlieÃen 227var y = window.scrollY; 228 229// Variable, die festlegt ob der MobiNav Button geklickt werden kann 230let clickActive = true; 231// Mobile Navigation öffnen und schlieÃen 232$(".hamburger.hamburger--collapse").click(function() { 233 if (clickActive){ 234 if ($(".mainNavOverlay").hasClass("active")) { 235 // Navigation zusammenklappen 236 collapseNav(); 237 console.log("111"); 238 $('#top').removeClass('no-scroll'); 239 window.scrollTo(0, y); 240 }else { 241 showNav(); 242 $('#tccBurgerMenu').toggleClass('is-active'); 243 console.log("222"); 244 y = window.scrollY; 245 window.setTimeout(function(){$('#top').addClass('no-scroll');}, 800); 246 } 247 248 // Verhindert das klicken für 300ms 249 clickActive = false; 250 setTimeout(function() { 251 clickActive = true; 252 }, 800); 253 } 254 255}); 256 257 258 259// Navigation Kindelemente anzeigen lassen 260$('#tccEasyMobileNav ul.level_2').hide(); 261 262
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.