【发布时间】:2016-01-20 17:03:15
【问题描述】:
所以我有一些 jQuery UI 对话框,为了用户可用性,我认为如果用户能够在框外单击时关闭对话框,而不是单击对话框上的小关闭按钮,那将是最好的。
jQuery 代码:
$(document).ready(function() {
var dlg=$('#createTeam').dialog({
title: 'Create a Team',
resizable: true,
autoOpen:false,
modal: true,
hide: 'fade',
width:600,
height:285,
clickOutside: true, // clicking outside the dialog will close it
clickOutsideTrigger: "#addEngineer",
close: function(event, ui) {
location.reload();
}
});
$('#createTeamLink').click(function(e) {
dlg.load('admin/addTeam.php');
e.preventDefault();
dlg.dialog('open');
});
});
谁能建议我需要在上面的代码中添加什么内容才能在框外单击鼠标时关闭对话框?
【问题讨论】:
标签: javascript jquery html jquery-ui