Category : accordion

I am trying to insert dynamic content inside a Semantic-UI Accordion. Basically I have to render a JSON input to the html as an Accordion. Here is the script and the html I am using for the above purpose:- <script language=’javascript’> $(document).ready(function(){ $(‘.ui.accordion’).accordion(); $(‘.ui.accordion’).accordion({onOpen: function() { // function for dynamically inserting content inside clicked element ..

Read more

I have these accordions that open and close. I’d also like the accordion to scroll to the top of the page when it’s clicked. HTML: <button class="accordion"><h2>Title</h></button> <div class="panel"> <p>some text</p> </div> Javascript that works to open and close the accordion: var acc = document.getElementsByClassName("accordion"); var i; for (i = 0; i < acc.length; i++) ..

Read more