943,907 Members | Top Members by Rank

Ad:
Aug 14th, 2008
0

Accordion script

Expand Post »
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?
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
swanqute is offline Offline
8 posts
since Jun 2008
Aug 14th, 2008
0

Re: Accordion script

are you writting this from scratch or using a framework?

you might want to take a look here: http://docs.mootools.net/Plugins/Accordion
Reputation Points: 12
Solved Threads: 3
Newbie Poster
jel3 is offline Offline
18 posts
since May 2008

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in JavaScript / DHTML / AJAX Forum Timeline: document.getElementByTagName("a").href - will this work??
Next Thread in JavaScript / DHTML / AJAX Forum Timeline: Script works in IE, but not in Firefox





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC