mootools effects in component view

Have a programming question regarding your component, plug-in, extension or core hacks? Have an interesting tidbit, FAQ or programming tip you’d like to share? This is the place for you.

Moderators: tjay, seadap, Rogue4ngel, matthewhayashida

Post Reply
User avatar
madsamurai
Joomla! Apprentice
Joomla! Apprentice
Posts: 20
Joined: Tue Oct 02, 2007 6:13 pm

mootools effects in component view

Post by madsamurai » Tue Oct 02, 2007 6:52 pm

Hi. sorry for double posting this, but this seems the more appropriate area for this question.
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...

User avatar
madsamurai
Joomla! Apprentice
Joomla! Apprentice
Posts: 20
Joined: Tue Oct 02, 2007 6:13 pm

Re: mootools effects in component view

Post by madsamurai » Wed Oct 03, 2007 4:51 pm

ok, got that working... just hadn't closed my

Post Reply