1jQuery(function( $ ){ 2 3 // Favoriten-Slider für die Startseite 4 $('#slider').flexslider({ 5 pauseOnHover: true, 6 animation: 'slide', 7 controlNav: false 8 }); 9 10 // Link zu allen Favoriten in die Slidernavi schieben 11 // Da sie vom Plugin automatisch generiert wird, kann man den Inhalt nicht ohne weiteres direkt ändern 12 $(window).load(function(){ 13 $('.flex-direction-nav').append('<a class="slider-all" href="' + pdata.favurl + '">Alle Darmstadt Kultur Tipps</a>'); 14 }); 15 16 // Nur Desktop: Menü bleibt nach Mouseover stehen, bis ein anderes gewählt wird 17 $('#nav .parent > li').mouseover(function(){ 18 if( $('body').outerWidth() > 767 ) 19 { 20 $('#nav .parent > li > .sub-menu').hide(); 21 $(this).children('.sub-menu').show(); 22 } 23 }); 24 25 // #nav-toggle beinhaltet Toggles für Menü und Suche, wird nur auf mobilen Geräten angezeigt 26 $('#nav-toggle-menu').click(function(){ 27 var wasVisible = $('#nav-content-menu').is(':visible'); 28 $('.nav-content').slideUp(); 29 30 if( wasVisible ) 31 return; 32 33 $('#nav-content-menu').slideDown(); 34 }); 35 $('#nav-toggle-search').click(function(){ 36 var wasVisible = $('#nav-content-search').is(':visible'); 37 $('.nav-content').slideUp(); 38 39 if( wasVisible ) 40 return; 41 42 $('#nav-content-search').slideDown(); 43 }); 44 45 // Nur mobil: Dritte Ebene bei Klick auf übergeordneten Navigationspunkt einblenden 46 $('#nav .parent > li > .sub-menu > li > a, #nav .parent > li > .sub-menu > li > span.fakelink').click(function(){ 47 if( $('body').outerWidth() < 768 ) 48 $(this).siblings('.sub-menu').slideToggle(); 49 }); 50 51 // Ein noch nicht ganz funktionierender Fix fürs Aufklappen der zweiten Navi-Ebene auf Touch-Geräten, die sich nicht mit :hover vertragen 52 $('#nav .parent > li > a, #nav .parent > li > span.fakelink').click(function(){ 53 if( $('body').outerWidth() > 767 ) 54 { 55 $('#nav .parent > li > .sub-menu').hide(); 56 $(this).siblings('.sub-menu').show(); 57 } 58 }); 59 60 // Beim Klick auf ein Listenelement (Favoriten, Ausgehtipps, ...) die zugehörigen Infos einblenden 61 $('.recommendations-link').click(function( event ){ 62 event.preventDefault(); 63 $(this).parents('.recommendations-item').find('.recommendations-body').slideToggle(); 64 var revertScrollPositionTo = $(window).scrollTop(); 65 window.location.hash = $(this).parents('li').attr('id'); 66 $(window).scrollTop(revertScrollPositionTo); 67 }); 68 69 // Beim Laden der Seite hübsch zum Hash scrollen, falls er gesetzt ist (Favoriten und Ausgehtipps) 70 $(window).load(function(){ 71 var hash = window.location.hash; 72 if( hash != '' && $( hash ).length ) 73 { 74 $( hash ).children( '.recommendations-body' ).slideDown(); 75 $('html,body').animate({ 76 scrollTop: $( hash ).offset().top 77 }); 78 } 79 }); 80 81 if( typeof( $('#pdfurl').val() ) != 'undefined' ) 82 { 83 if( $('body').outerWidth() > 1024 ) 84 { 85 $('#pdfurl').replaceWith('<embed src="' + $('#pdfurl').val() + '" width="100%" height="660">'); 86 } 87 else 88 { 89 $('#pdfurl').replaceWith('<a href="' + $('#pdfurl').val() + '"><img src="' + $('#pdfcover').val() + '" alt=""><br>Jetzt als PDF runterladen!</a>'); 90 } 91 } 92 93 94 // ODD EVEN BG COLOR FAVORITEN 95 96 $('.recommendations-item:visible:odd').css('background', '#f7f7f7'); 97 $('.recommendations-item:visible:even').css('background', '#fdec1c'); 98 99 /* hide if ads not accepts to continue on popup */ 100 function checkAndHide() { 101 var $innerDiv = $('.content-banner .sdgSticky div, .content-sky-banner .sdgSticky div, .sidebar-banner .sdgSticky div, .content-pubperform .sdgSticky div'); 102 var $parentDiv = $('.content-banner, .content-sky-banner, .sidebar-banner, .content-pubperform'); 103 104 if ($.trim($innerDiv.html()) === '') { 105 // If inner div is blank, hide its parent 106 $parentDiv.addClass('hidden'); 107 } else { 108 // If inner div has content, show its parent 109 $parentDiv.removeClass('hidden'); 110 } 111 } 112 113 // Initial check on page load 114 checkAndHide(); 115 116 // Check every second (adjust interval as needed) 117 setInterval(checkAndHide, 1000); 118 /* End hide if ads not accepts to continue on popup */ 119 120});
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.