I have been working on a vertical accordion but seems not to be working, Can some one please check where the error is?

Thanks in advance;

At the Head
Event.observe(window, 'load', loadAccordions, false);


                function loadAccordions() {
                var verticalAccordions = $$('.accordion_toggle');
                verticalAccordions.each(function(accordion) {
                $(accordion.next(0)).setStyle({
             height: '0px'
    });

            var Accordion = new accordion('vertical_container');

             {
              classNames : {
                    toggle : 'vertical_accordion_toggle',
                    toggleActive : 'vertical_accordion_toggle_active',
                    content : 'vertical_accordion_content',
                }
            });
            defaultSize : {
    height : null,
    width : null
},
direction : 'vertical',

onEvent : 'click'


            Accordion.activate($$('#vertical_content .accordion_toggle')[0]);

                    }

HTML

<div id="Content">
  <table width="570px"  cellpadding="2" cellspacing="5">
  <tr>
  <td>
    <h2 class="accordion_toggle" align="left">......</h2>
    <div class="accordion_content" align="justify">
............................................................
............................................................
    </div>
</td>
</tr>
</div>


<script type="text/javascript" >

    var verticalAccordions = $$('.accordion_toggle');
    verticalAccordions.each(function(accordion) {
        $(accordion.next(0)).setStyle({
          height: '0px'
        });
    });


</script>

</body>

Is something wrong with the code or did I miss out sth?

Edited 3 Years Ago by mike_2000_17: Fixed formatting

This article has been dead for over six months. Start a new discussion instead.