views:

241

answers:

1

By creating the appropriate markup for Tabs, I've been able to place a jQuery UI Tabs widget inside a jQuery UI Dialog; but doing the same with an Accordion has not worked: clicking on the anchor of the accordion section causes the Dialog to close. Is there a straightforward way to accomplish this?

+1  A: 

Works fine for me... I posted a demo for you.

Maybe you needed to use the "open" option in the dialog function?

  $(function() {
    $("#dialog-modal").dialog({
      height: 400,
      width: 400,
      modal: true,
      open: function(){
        $("#accordion").accordion({ autoHeight: true });
      }
    });
  });

Note: For tabs, it's basically the same thing, add the function call inside the open option.

fudgey
@fudgey: Thanks very much! Works like a charm. Don't know why my Dialog was closing when the accordion section-header was clicked. It was set up like yours, though mine was not modal, as your example is, and I had multiple stackable dialogs too; but I changed your example to reflect these differences and it still worked. Now that I know it's possible, I can search out what might be causing the problem on my page. Thanks again.
Tim