当前位置: 动力学知识库 > 问答 > 编程问答 >

is it possible to stick jquery ui tabs inside of a jquery ui dialog

问题描述:

i have a web page that i want to load dynamically (ajax) into a jquery ui dialog. the page has multiple jquery tabs and when i load this into the dialog each tab is showing up as a regular link and the tab widget is not shown. Is this a known issue? Is there any workaround to support having jquery ui tabs inside of a dialog.

网友答案:

yes its possible. here is a simple example ...

JS Fiddle Example

网友答案:

You might want to add an open handler to retrieve your content and set up the tabs when you do so.

$(function() {
    $('#dialog').dialog({
        autoOpen: false,
        modal: true,
        buttons: {
            'OK' : function() {
                        $(this).dialog('close');
                   },
            'Cancel': function() {
                        $(this).dialog('close');
                   }
        },
        open: function(event,ui) {
           $(ui.panel).find('div')
                      .load('http://www.example.com')
                      .find('.tabs')
                      .tabs();
        }
    });
    $('.dialog-button').click( function() {
        $('#dialog').dialog('open');
        return false;
    });
});

<div id="dialog"  title="Dialog" style="display: none;">
    <div class="dialog-content">
    </div>
</div>
分享给朋友:
您可能感兴趣的文章:
随机阅读: