Opened 14 years ago

Closed 13 years ago

#4004 closed bug (duplicate)

Accordion does not work when loaded later via Ajax

Reported by: abtrapp Owned by:
Priority: major Milestone: 1.8
Component: ui.accordion Version: 1.6rc6
Keywords: Cc:
Blocked by: Blocking:

Description

The accordion standard sample (http://ui.jquery.com/demos/accordion/#default) works perfect, if it loads with the complete form.

When it is loaded via Ajax (inside of a jQuery Ajax Tab) and is initialized with:

jQuery('#payment_type').each(function(item) {jQuery(this).accordion ({header: "h3"});});

every content is set to style="... height: 0" - so all headers are attached together and the content is below them.

Change History (6)

comment:1 Changed 14 years ago by rdworth

Summary: Accordeon does not work when loaded later via AjaxAccordion does not work when loaded later via Ajax

comment:2 Changed 14 years ago by Scott González

Milestone: TBD1.6

I believe the real problem is that the heights are not being calculated properly if the accordion is not attached to the DOM.

comment:3 Changed 14 years ago by rdworth

Milestone: 1.71.8

comment:4 Changed 14 years ago by justin.obara

This sounds like a problem that I was having, that could be solved by using the options clearStyle: true and autoHeight: false. However, in 1.6rc6 there is a bug which throws an error in IE when using these options. This is supposed to be fixed in trunk though ( http://dev.jqueryui.com/ticket/4100 )

comment:5 Changed 14 years ago by naz

I had a same problem, how ever cleadStyle and autoHeight did not work for me. The only way I managed to fix was destroying accordion and call it again.

$('#navigation').tabs({ 
    show: function(ui) {
        $("#packages").tabs('destroy').tabs({ 
            show: function(ui) {
               $('#offers').accordion('destroy').accordion(accordionConfig);
            } 
        });
    } 
});

comment:6 Changed 13 years ago by Scott González

Resolution: duplicate
Status: newclosed

Duplicate of #3905.

Note: See TracTickets for help on using tickets.