0
在父页面上有按钮点击打开加载另一个网页的jQuery UI对话框。在子页面上有“关闭”按钮来关闭对话框。我可以在对话框中加载子页面,但有几个问题。我搜索了很多网站(尝试使用销毁和删除对话框,或者点击按钮)并没有找到解决方案。希望有人能帮助我解决它。提前致谢。对话框没有完成关闭,为什么不呢?
有我的问题:
- 父页面上的打开按钮关闭对话框
- 点击对话框中的“关闭”按钮后消失后,对话框是接近,但股利是即使我改变显示为无。
有父:
点击子页面上的关闭按钮后。
还有就是我的父页面代码:
<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="Test.aspx.vb" Inherits="COMM.Test" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Test</title>
<link rel="stylesheet" href="/include/jquery-ui-themes-1.11.4/themes/smoothness/jquery-ui.css" />
<script language="javascript" src="/include/jquery-2.1.4.min.js" type="text/javascript"></script>
<script language="javascript" src="/include/jquery-ui-1.11.4/jquery-ui.js" type="text/javascript"></script>
<script language="javascript" src="/include/dailog.js" type="text/javascript"></script>
<script type="text/javascript" language="javascript">
$(document).ready(function() {
$('#btnOpen2').click(function (e) {
e.preventDefault();
openDailog();
});
});
</script>
</head>
<body>
<form id="form1" runat="server">
<div><h1>Test</h1>
<div id="somediv" />
<button id="btnOpen2"> Open 2</button>
</div>
</form>
</body>
</html>
的子页面:
<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="TestClose.aspx.vb" Inherits="COMM.TestClose" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
<link rel="stylesheet" href="/include/jquery-ui-themes-1.11.4/themes/smoothness/jquery-ui.css" />
<script language="javascript" src="/include/jquery-2.1.4.min.js" type="text/javascript"></script>
<script language="javascript" src="/include/jquery-ui-1.11.4/jquery-ui.js" type="text/javascript"></script>
<script language="javascript" src="/include/dailog.js" type="text/javascript"></script>
<script type="text/javascript" language="javascript">
$(document).ready(function() {
$('#btnClose').click(function (e) {
e.preventDefault();
closeDailog();
});
});
</script>
</head>
<body>
<form id="form1" runat="server">
<div>
<button id="btnClose"> close</button>
</div>
</form>
</body>
</html>
还有就是我的js代码:
function openDailog() {
$("#somediv").load('TestClose.aspx').dialog({
autoOpen: false,
modal: true,
dialogClass: 'dialog',
resizable: false,
width: 500,
height: 400,
title: 'Close diaglog'
});
$("#somediv").dialog("open");
return false;
}
function closeDailog() {
$('#somediv').dialog({
autoOpen: false,
modal: true,
dialogClass: 'dialog',
resizable: false,
width: 500,
height: 400
});
$("#somediv").dialog("close");
$(".ui-dialog-titlebar").hide();
$("#somediv").css("display", "none");
}
我想要子页面(对话框完全消失)和父页面重新加载。 – user819774
如果只关闭对话框,我将显示器更改为div上没有显示,但它没有正确执行。 – user819774