Accordion widget (marco) - collapsing one accordion menu when another is opened

View: New views
3 Messages — Rating Filter:   Alert me  

Accordion widget (marco) - collapsing one accordion menu when another is opened

by rolfsf :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I've just started using Marco's accordion widget (http://www.i-marco.nl/weblog/yui-accordion/) and have a question...

I have two different accordion sets - accordion1 and accordion2. Both are configured identically:

accordion1 = new YAHOO.widget.AccordionView('accordion01', {collapsible: true, width:'100%', animationSpeed: '0.3', animate: true, effect: YAHOO.util.Easing.easeBothStrong});

accordion2 = new YAHOO.widget.AccordionView('accordion02', {collapsible: true, width:'100%', animationSpeed: '0.3', animate: true, effect: YAHOO.util.Easing.easeBothStrong});

Though I've got 2 accordions, I only want a max of one accordion panel open at a time, so if a panel is open in accordion1 and I click to expand a panel in accordion2, I want accordion1 to collapse first.

Is there an easy way to accomplish that?

Thanks


Re: Accordion widget (marco) - collapsing one accordion menu when another is ope

by rolfsf :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

bump

Can anyone offer a tip for this?

Thanks

--- In ydn-javascript@..., "rolfsf" <rolfsf@...> wrote:

>
> I've just started using Marco's accordion widget (http://www.i-marco.nl/weblog/yui-accordion/) and have a question...
>
> I have two different accordion sets - accordion1 and accordion2. Both are configured identically:
>
> accordion1 = new YAHOO.widget.AccordionView('accordion01', {collapsible: true, width:'100%', animationSpeed: '0.3', animate: true, effect: YAHOO.util.Easing.easeBothStrong});
>
> accordion2 = new YAHOO.widget.AccordionView('accordion02', {collapsible: true, width:'100%', animationSpeed: '0.3', animate: true, effect: YAHOO.util.Easing.easeBothStrong});
>
> Though I've got 2 accordions, I only want a max of one accordion panel open at a time, so if a panel is open in accordion1 and I click to expand a panel in accordion2, I want accordion1 to collapse first.
>
> Is there an easy way to accomplish that?
>
> Thanks
>



Re: Re: Accordion widget (marco) - collapsing one accordion menu when another is ope

by Martin Kamerbeek :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I haven't tried this out at all, but my guess from skimming the API docs
is that you'd attach an event listener to the panelOpen event of both
accordions that closes all the open panels in both of em.

The API is here:
http://www.i-marco.nl/weblog/yui-accordion/docs/YAHOO.widget.AccordionView.html

Martin

rolfsf wrote:

> bump
>
> Can anyone offer a tip for this?
>
> Thanks
>
> --- In ydn-javascript@..., "rolfsf" <rolfsf@...> wrote:
>  
>> I've just started using Marco's accordion widget (http://www.i-marco.nl/weblog/yui-accordion/) and have a question...
>>
>> I have two different accordion sets - accordion1 and accordion2. Both are configured identically:
>>
>> accordion1 = new YAHOO.widget.AccordionView('accordion01', {collapsible: true, width:'100%', animationSpeed: '0.3', animate: true, effect: YAHOO.util.Easing.easeBothStrong});
>>
>> accordion2 = new YAHOO.widget.AccordionView('accordion02', {collapsible: true, width:'100%', animationSpeed: '0.3', animate: true, effect: YAHOO.util.Easing.easeBothStrong});
>>
>> Though I've got 2 accordions, I only want a max of one accordion panel open at a time, so if a panel is open in accordion1 and I click to expand a panel in accordion2, I want accordion1 to collapse first.
>>
>> Is there an easy way to accomplish that?
>>
>> Thanks
>>
>>    
>
>
>
>
> ------------------------------------
>
> Yahoo! Groups Links
>
>
>
>