This is the community forum. For a developer response use the Client Area.
Follow us on Facebook, Twitter and YouTube!

How to use accordion button?
#1

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

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.
Reply


Possibly Related Threads…
Thread / Author Replies Views Last Post

Forum Jump:


Users browsing this thread: 1 Guest(s)