[英]jquery modal dialog is laughing at me - dialog shows up modeless
我陷入困境,試圖顯示一個簡單的jquery模態對話框。 顯示該對話框,但以無模式的方式。
我已經閱讀了其他帖子並進行了檢查:
我究竟做錯了什么?
HTML
<div id="userPanelDlg">
<div class="input -clearfix">
<p>User</p>
<input name="username" type="text">
<p>Pass</p>
<input name="password" type="text">
</div>
</div>
Java腳本
$("#userPanelDlg").dialog({
resizable: false,
height: 'auto',
width: 'auto',
modal: true,
buttons: {
"Ok": function () {
$(this).dialog("close");
}
}
});
我發現了問題。 我誤解了基本的javascript概念。 對話框顯示為模態對話框,但在執行dialog()調用后執行。 我認為,就像在其他語言(如Java)中一樣,dialog({modal:true})是一個阻塞調用(如Java中的dialog.setVisible(true))。 謝謝您的幫助
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.