1$(window).scroll(function() { 2 var body = $("body"); 3 if ($(this).scrollTop() > 100) { 4 body.addClass("cd-scroll"); 5 } else { 6 body.removeClass("cd-scroll"); 7 } 8}); 9 10var openMenu = function() { 11 var body = $("body"); 12 if (body.hasClass("cd-megamenu-open")) { 13 return; 14 } 15 16 var megaMenu = $(".cd-megamenu"); 17 var megaMenuButton = $(".cd-megamenu-button"); 18 var megaMenuContainer = $(".cd-megamenu-container"); 19 20 body.addClass("cd-megamenu-open"); 21 megaMenuButton.addClass("cd-megamenu-button-open"); 22 megaMenu.slideToggle(700, function() { 23 /* Bei zu geringerer Höhe scrolling enablen durch setzen der Höhe */ 24 var windowHeight = $(window).innerHeight(); 25 var navigationHeight = megaMenuContainer.position().top; 26 var height = windowHeight - navigationHeight; 27 28 if (height < megaMenuContainer.height()) { 29 megaMenuContainer.height(height); 30 } 31 }); 32}; 33 34var closeMenu = function() { 35 var body = $("body"); 36 if (!body.hasClass("cd-megamenu-open")) { 37 return; 38 } 39 40 var megaMenu = $(".cd-megamenu"); 41 var megaMenuButton = $(".cd-megamenu-button"); 42 var megaMenuContainer = $(".cd-megamenu-container"); 43 44 megaMenu.slideToggle(700, function() { 45 body.removeClass("cd-megamenu-open"); 46 megaMenuButton.removeClass("cd-megamenu-button-open"); 47 megaMenuContainer.height("auto"); 48 }); 49}; 50 51var toggleMenu = function( event ) { 52 event.stopPropagation(); 53 54 if ($("body").hasClass("cd-megamenu-open")) { 55 closeMenu(); 56 } else { 57 openMenu(); 58 } 59}; 60 61$(".cd-megamenu-button").click(toggleMenu); 62$(document).click(closeMenu); 63function topFunction() { 64 $('html, body').animate({scrollTop: 0}, 1200); 65}
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.