Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
有没有办法让 jQuery 模态对话框成为“真正的”模态?
例如,如果我为是/否创建一个确认对话框,我如何在处理其他任何内容之前等待用户的响应。
TIA
您必须将对话框后的逻辑放入对话框的按钮事件中。您不能使用它来暂停方法中间流的执行。只有本机 javascript 警报/确认框可以做到这一点。
$( ".selector" ).dialog({ buttons: [ { text: "Ok", click: function() { // do whatever you want on OK. } } ] });
http://jqueryui.com/demos/dialog/