Difference between revisions of "Template:Cologne-Duesseldorf/js-jquery"

Line 40: Line 40:
 
 
 
</script>
 
</script>
 
 
 
 
<!-- w3 Accordion -->
 
<script>
 
var acc = document.getElementsByClassName("accordion");
 
var i;
 
 
for (i = 0; i < acc.length; i++) {
 
  acc[i].onclick = function() {
 
this.classList.toggle("active");
 
var panel = this.nextElementSibling;
 
if (panel.style.maxHeight){
 
  panel.style.maxHeight = null;
 
} else {
 
  panel.style.maxHeight = panel.scrollHeight + "px";
 
}
 
  }
 
}
 
</script>
 
 
</body>
 
</body>
 
</html>
 
</html>

Revision as of 12:45, 5 May 2017