ok here is what I have in my view file.
<?php
echo $javascript->link(array('prototype', 'scriptaculous', 'accordion' ),
false);
?>
<script type="text/javascript">
//
// In my case I want to load them onload, this is how you
do it!
//
Event.observe(window, 'load', loadAccordions, true);
//
// Set up all accordions
//
function loadAccordions() {
var topAccordion = new
accordion('horizontal_container', {
classNames : {
toggle :
'horizontal_accordion_toggle',
toggleActive :
'horizontal_accordion_toggle_active',
content :
'horizontal_accordion_content'
},
defaultSize : {
width : 525
},
direction : 'horizontal'
});
var bottomAccordion = new
accordion('vertical_container');
var nestedVerticalAccordion = new
accordion('vertical_nested_container', {
classNames : {
toggle :
'vertical_accordion_toggle',
toggleActive :
'vertical_accordion_toggle_active',
content :
'vertical_accordion_content'
}
});
// Open first one
bottomAccordion.activate($$('#vertical_container
.accordion_toggle')[0]);
// Open second one
topAccordion.activate($$('#horizontal_container
.horizontal_accordion_toggle')[2]);
}
</script>
<div id="vertical_container">
<h1 class="accordion_toggle">title 1:</h1>
<div class="accordion_content">
<div id="test_work"> <?php echo $this->element('dummy_accordion'); ?>
</div>
</div>
<h1 class="accordion_toggle">title 1:</h1>
<div class="accordion_content">
<div id="test_work"> <?php echo $this->element('dummy_accordion'); ?>
</div>
</div>
<h1 class="accordion_toggle">title 1:</h1>
<div class="accordion_content">
<div id="test_work"> <?php echo $this->element('dummy_accordion'); ?>
</div>
</div>
<h1 class="accordion_toggle">title 1:</h1>
<div class="accordion_content">
<div id="test_work"> <?php echo $this->element('dummy_accordion'); ?>
</div>
</div>
</div>
<!--END ACCORDION-->
<div class="bottom_shadow"></div>
</div>
The element('dummy_accordion') is just <p>content here</p> which shows up
fine. The structure is there when I view the page. Justno accordion action.
No errors are reported.
-----Original Message-----
From: Stu [mailto:[email protected]]
Sent: March-06-09 3:32 PM
To: CakePHP
Subject: Re: Accordion
Hehe, I got this working 2 days ago,
Check out his source code, there's more then a few hints in there.
But yeah, post your code. So we can see whats going on.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"CakePHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---