Difference between revisions of "Template:Virginia"

Line 120: Line 120:
  
  
 +
</script>
 +
 +
 +
 +
 +
 +
 +
<style>
 +
div.panel {
 +
    padding: 0 18px;
 +
    background-color: white;
 +
    max-height: 0;
 +
    overflow: hidden;
 +
    transition: max-height 0.2s ease-out;
 +
}
 +
</style>
 +
 +
<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>
 
</script>
  

Revision as of 03:48, 1 November 2017