调用JQuery弹出关闭按钮上的JS'X'
call JS on JQuery popup close button 'X'
我有一个Jquery弹出窗口:
<script type="text/javascript">
function showAccessDialog() {
var modal_dialog = $("#modal_dialog");
modal_dialog.dialog
(
{
title: "Access Level",
buttons:
{
},
modal: true,
width:680,
}
).parent().appendTo("form:first");
};
function closeAccessDialog() {
var modal_dialog = $("#modal_dialog");
modal_dialog.dialog('close');
};
</script>
<div id="modal_dialog" style="display: none; width:500">
<asp:Panel ID="SelectGroupsPanel" runat="server" BackColor="Snow" Width="500"
HorizontalAlign="Center">
<asp:UpdatePanel runat="server" ID="SelectGroupsUpdatePanel" UpdateMode="Conditional" ChildrenAsTriggers="false">
<ContentTemplate>
<p style="color:red; text-align: left">Select groups from the drop downs</p>
<p style="text-align: left">
View Map
<br />
<asp:DropDownList ID="ddlViewMapGroupName" AppendDataBoundItems="true" runat="server">
<asp:ListItem Text="Select Group" Value="0" Selected="True"></asp:ListItem>
</asp:DropDownList>
</p>
<p style="text-align: left">
Edit Map
<br />
<asp:DropDownList ID="ddlEditMapGroupName" AppendDataBoundItems="true" runat="server">
<asp:ListItem Text="Select Group" Value="0" Selected="True"></asp:ListItem>
</asp:DropDownList>
</p>
<div class="buttonwrap">
<span id="Span5" class="ActionBtns">
</span>
</div>
<br />
<br />
</ContentTemplate>
<Triggers>
<asp:AsyncPostBackTrigger ControlID="SaveAccess" EventName="Click" />
<asp:AsyncPostBackTrigger ControlID="ShareMapsBtn" EventName="Click" />
</Triggers>
</asp:UpdatePanel>
<asp:Button ID="SaveAccess" runat="server" Text="Update" OnClick="SaveAccess_Click" OnClientClick="uncheckAllCheckboxes()" style="text-align:center" />
</asp:Panel>
</div>
我的Q是-当用户从下拉列表中选择值并单击"更新"按钮时,调用"OnClientClick="uncheckAllCheckboxes()",删除所有选中的复选框。-正在工作。
如果用户按下弹出窗口右上角的"X"按钮,我也想调用"uncheckAllCheckboxes()"
我该怎么做?
close
-函数:
modal_dialog.dialog({
title: "Access Level",
buttons: {},
modal: true,
width: 680,
close: function() {
uncheckAllCheckboxes();
}
});
演示
旁注:使用选项closeOnEscape: true
,如果用户按下escape
-按钮,关闭功能也将触发。
参考
对话框-关闭
$( ".selector" ).dialog({
close: function( event, ui ) {
//write your function here or call function here
}
});
文档
使用完整链接
相关文章:
- 是否有一个JS/jQuery函数可以获取某个类的每个元素的ID
- 点击facebook像素跟踪注册(JS/JQUERY代码)
- 用于发现哪个JS/jQuery脚本正在冻结页面的工具或技术
- 使用js/jQuery检查对象(而不是元素)是否真的存在
- 如何使用JS/jQuery在另一个网站上显示iframe中的特定内容
- 在坐标上模拟点击坐标js/jQuery
- 如何插入js/jquery变量isideHTML标记
- 我需要JS/jQuery中的倒计时计时器
- 当我使用JS/jQuery/any插件点击图像时,我如何使背景变暗+不可点击,并放大和居中我的图像
- JS/jquery:我将如何遍历HTML中的每个图像
- 非常奇怪的JS/jQuery行为-alert()包含/排除
- JS/Jquery - 如果输入具有数组的任何名称,则返回关联的值
- 使用 js/jQuery/css 在重力形式中覆盖 !important
- 如何在 js / jquery 中绑定“数据追加”事件
- 解析 RSS 命名空间媒体:缩略图 (js/jQuery)
- AJAX/page refresh kills JS/jQuery
- 带有post值的JS jQuery重定向,不带<表单>
- 改变与“"至“-"(JS/Jquery)
- 我正在尝试使用JS/JQuery自动对网站中的文本执行多个查找和替换操作
- 是否覆盖网站上文本输入区域的默认移动设备键盘?(HTML/JS/jQuery)