jquery-ui autoOpen:false不允许对话框在事件触发后保持打开状态

时间:2014-01-18 20:07:31

标签: jquery jquery-ui modal-dialog

当我包含autoOpen:False,行到我的脚本,然后单击id =“opener”的按钮时,对话框会闪烁一段时间然后关闭。脚本是:

  <script>
     $( "#dialog" ).dialog({
         autoOpen: false,
         modal: true,
         width: 500,
      dialogClass: "dlg-no-title",
       buttons: [
         {
           text: "OK",
           click: function() {
             $( this ).dialog( "close" );
           }
         }
       ]
     });
     $( "#opener" ).click(function() {
       $( "#dialog" ).dialog( "open" );
     });
  </script>

在我看来,我发现的每个样本都是一样的,但我显然忽略了一些东西。它发生在Safari和Chrome中。

0 个答案:

没有答案