11-Oct-2017, 01:14 PM
Hi! Want to show/hide commentics block by click? Pasted
<button class="accordion"]><?php echo $lang_heading_comments; ?></button>
in /frontend/view/default/template/main/comments.tpl
and pated code in header.tpl
But button is not working. I've noticed that commentics already have sccordion function. Write please a small tut how to make commentics block dropdown.
Thanks.
<button class="accordion"]><?php echo $lang_heading_comments; ?></button>
in /frontend/view/default/template/main/comments.tpl
and pated code in header.tpl
Code:
<script>var acc = document.getElementsByClassName("accordion");
var i;
for (i =0; i < acc.length; i++) {
acc[i].onclick = function(){
this.classList.toggle("active");
var cmtx_comments_container = this.nextElementSibling;
if (cmtx_comments_container.style.display ==="block") {
cmtx_comments_container.style.display = "none";
} else {
cmtx_comments_container.style.display ="block";
}
}
}
</script>
But button is not working. I've noticed that commentics already have sccordion function. Write please a small tut how to make commentics block dropdown.
Thanks.