I'm developing my first component from scratch, and am having problems using mootools accordion in my view. I just can't make it work, and don't know what I'm missing.
Here's the code in my default view template:
Code: Select all
<?php
// no direct access
defined( '_JEXEC' ) or die( 'Restricted access' );
?>
<script type="text/javascript" src="includes/js/mootools.js"/>
<script language="javascript" type="text/javascript">
window.onload = function(){
var title = document.getElementByClassName('boxtitle');
var body = document.getElementByClassName('boxbody');
var accordionEffect = new fx.Accordion(title, body, {});
};
</script>
<div id="CartItemDetail">
<?php $imagepath = 'components'.DS.'com_catalog'.DS.'images'.DS.'cartitemlayout'.DS; ?>
<img src="<?php echo $imagepath; ?>details.png"/>
<div id="accordion">
<h3 class="boxtitle">Colors and Sizes</h3>
<div class="boxbody">
<img src="<?php echo $imagepath; ?>colors.png"/>
</div>
<h3 class="boxtitle">Art Configuration</h3>
<div class="boxbody">
<img src="<?php echo $imagepath; ?>artconfig.png"/>
</div>
</div>
<img src="<?php echo $imagepath; ?>savebar.png"/>
</div>
simple enough... seems like it should work, but doesn't. Doesn't do anything at all, or give an error. Can anyone tell me what I'm missing here so I can get on with this?
Thanks in advance...