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.
当用户单击后台页面的其余部分时,我想关闭查询 ui 模态框。
我添加了这个片段来做到这一点,但它不起作用:
$('.ui-widget-overlay').on("click", function() { //Close the dialog $(this).find(".dialog").dialog("close"); });
例子
$('body').on('click','.ui-widget-overlay', function() { $('.ui-dialog').filter(function () { return $(this).css("display") === "block"; }).find('.ui-dialog-content').dialog('close'); });
演示
这有效......在这里找到