Semantic UI Accordion not working properly

Fᴀʀʜᴀɴ Aɴᴀᴍ picture Fᴀʀʜᴀɴ Aɴᴀᴍ · Jun 7, 2015 · Viewed 12.4k times · Source

I have an accordion element in my page. The problem is that the accordion appears on the page but it is not clickable. By 'not clickable', I mean that when I click on the header it does not expand to reveal the contents. Nothing happens at all. I hope someone can help.

Thanks in advance.

Answer

Biraj Bora picture Biraj Bora · Jun 24, 2015

Your jQuery.js module must be loaded before the semantic-ui accordion.js module.

Simply put

<script src="js/accordion.js"></script>

after

<script src="js/vendor/jquery-1.11.2.min.js"><\/script>

( or whatever your jQuery version is ... )

and initialize the accordion in the html document inside a script tag as :

<script language='javascript'>
             $(document).ready(function(){
                $('.ui.accordion').accordion();
             });
</script>