1$(".teaser-accordion h3").click(function () { 2 $(this).parent().find(".content").slideToggle(); 3}); 4 5//ganze Box verlinken 6function linkWholeBox(cssClass) { 7 var container = $(cssClass); 8 9 if (container.find("a").length > 0) { 10 container.css("cursor", "pointer"); 11 12 container.click(function () { 13 location.href = $(this).find("a").attr("href"); 14 }); 15 16 container.mouseover(function () { 17 $(this).attr("title", $(this).find("a").attr("title")); 18 }); 19 } 20} 21 22$(function () { 23 linkWholeBox(".teaser-box-background"); 24 linkWholeBox(".news-teaser"); 25 linkWholeBox(".value-chain-service"); 26 linkWholeBox(".closer .Article"); 27 linkWholeBox(".news-teaser-big"); 28 linkWholeBox(".news-teaser-article"); 29}); 30 31// check if element is in view 32function checkVisibility(el) { 33 const { top, bottom } = el.getBoundingClientRect(); 34 const { innerHeight } = window; 35 36 // only check the y axis, x axis is not relevant 37 const visible = top < innerHeight && bottom > 0; 38 39 if (visible) { 40 el.classList.add("svg-visible"); 41 } else { 42 el.classList.remove("svg-visible"); 43 } 44} 45 46document.addEventListener("DOMContentLoaded", () => { 47 // get animated svgs 48 const svgElements = document.querySelectorAll("svg[class*='svg-'"); 49 50 // check initial state 51 svgElements.forEach((item) => { 52 checkVisibility(item); 53 }); 54 55 // the slider causes the initial position of all svgs below it to be wrong 56 // when the slider initializes the bosy height changes 57 // check the visiblity again when that happens 58 const resizeObserver = new ResizeObserver((entries) => { 59 svgElements.forEach((item) => { 60 checkVisibility(item); 61 }); 62 }); 63 64 // observe body height 65 resizeObserver.observe(document.body); 66 67 // add scroll event 68 document.addEventListener("scroll", () => { 69 svgElements.forEach((item) => { 70 checkVisibility(item); 71 }); 72 }); 73 74 // add resize event 75 window.addEventListener("resize", () => { 76 svgElements.forEach((item) => { 77 checkVisibility(item); 78 }); 79 }); 80});
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.