Accordion script

Please support our JavaScript / DHTML / AJAX advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
Reply

Join Date: Jun 2008
Posts: 8
Reputation: swanqute is an unknown quantity at this point 
Solved Threads: 0
swanqute swanqute is offline Offline
Newbie Poster

Accordion script

 
0
  #1
Aug 14th, 2008
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?
we learn everyday...knowledge is shared
Reply With Quote Quick reply to this message  
Join Date: May 2008
Posts: 18
Reputation: jel3 is an unknown quantity at this point 
Solved Threads: 3
jel3's Avatar
jel3 jel3 is offline Offline
Newbie Poster

Re: Accordion script

 
0
  #2
Aug 14th, 2008
are you writting this from scratch or using a framework?

you might want to take a look here: http://docs.mootools.net/Plugins/Accordion
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the JavaScript / DHTML / AJAX Forum
Thread Tools Search this Thread



Tag cloud for JavaScript / DHTML / AJAX
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC