This project is archived and is in readonly mode.

#121 ✓ wontfix
kratsg

Accordion Fix? (A way to get nested accordions working properly)

Reported by kratsg | September 17th, 2009 @ 04:59 PM | in backlog (closed)

Currently, you're able to create new instances of the accordion class and nest them to create a nested menu (or similar). Most of the fixes included two very short pieces of code that could just be added to the Fx.Accordions class to get it to work.

//This first block helps define how to set the height of the elements inside the accordion depending on whether you use IE or not.

//IE6 Fix
if(window.ie6) var heightValue='100%';
else var heightValue='';


//This second part just basically resizes the height of the element so that when you open up a section nested inside a parent section, that parent section expands its own height to fit the nested section (instead of the nested section overlapping some of the parent elements)

onComplete: function() { 
    var element=$(this.elements[this.previous]);
    if(element && element.offsetHeight>0) element.setStyle('height', heightValue);           
}

What's nice about the fix is that it doesn't affect any code you've already made for the accordion, and it's a perfect solution, to be honest with you. Most of the nested accordions use a similar code and just loop through to create the nested accordions...

Comments and changes to this ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

The MooTools Extensions

Shared Ticket Bins

People watching this ticket

Pages