lib/isodoc/base_style/scripts.html in isodoc-2.11.0 vs lib/isodoc/base_style/scripts.html in isodoc-2.11.1
- old
+ new
@@ -183,5 +183,23 @@
placement: 'left'
};
anchors.add('h1, h2, h3, h4');
</script>
+<script>
+// use .collapsible element to toggle visibility of element following it
+var coll = document.getElementsByClassName("collapsible");
+var i;
+
+for (i = 0; i < coll.length; i++) {
+ coll[i].addEventListener("click", function() {
+ this.classList.toggle("active");
+ var content = this.nextElementSibling;
+ if (content.style.maxHeight){
+ content.style.maxHeight = null;
+ } else {
+ content.style.maxHeight = content.scrollHeight + "px";
+ }
+ });
+}
+</script>
+