0

我使用 jquery ui 并希望在 ajax 注入的 html 上有 ui-tabs。

如果我使用文档中的代码:

$(function() {
    $( ".tab" ).tabs();
});

在已经存在的 HTML 元素上,它可以工作。

但是现在,我想打开一个带有 ajax 内容的 jquery ui 对话框。有没有可能里面的html已经转成jquery ui tab系统了?

4

1 回答 1

0

这是一个在显示对话框之前加载动态内容的示例

<div id="dialog-message" title="Download complete">
    Default value
</div>

  $(function() {
    //Ajax call to load new text inside dialog-message
    $("#dialog-message").load("ajaxpage.php",function(){

        //Success callback, create and display the modal dialog

        //Delete dialog if already exists
        try{$(this).dialog('destroy');}catch(e){}

        //Create the new one
        $( this ).dialog({
          modal: true,
          buttons: {
            Ok: function() {
              $( this ).dialog( "close" );
            }  
          }
        });
    });
  });
于 2013-01-24T20:04:10.553 回答