复制代码 代码如下:
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
<style type ="text/css" >
.main{ background-color:Silver; width :200px; height :100px; margin-left:40%; margin-top :200px; text-align :center;}
</style>
<script src="/UploadFiles/2021-04-02/jquery-1.7.1.min.js"> <script language="javascript" type="text/javascript">
var n = 3;
function showTime() {
n--;
$('#divMain').html(n + ' 秒后关闭窗口');
if (n == 0)
window.close();
else
setTimeout('showTime()', 1000);
}
</script>
</head>
<body onload ="showTime()">
<form id="form1" runat="server">
<div id ="divMain" class ="main" >
</div>
</form>
</body>
</html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
<style type ="text/css" >
.main{ background-color:Silver; width :200px; height :100px; margin-left:40%; margin-top :200px; text-align :center;}
</style>
<script src="/UploadFiles/2021-04-02/jquery-1.7.1.min.js"> <script language="javascript" type="text/javascript">
var n = 3;
function showTime() {
n--;
$('#divMain').html(n + ' 秒后关闭窗口');
if (n == 0)
window.close();
else
setTimeout('showTime()', 1000);
}
</script>
</head>
<body onload ="showTime()">
<form id="form1" runat="server">
<div id ="divMain" class ="main" >
</div>
</form>
</body>
</html>
标签:
定时,关闭,窗口
免责声明:本站文章均来自网站采集或用户投稿,网站不提供任何软件下载或自行开发的软件!
如有用户或公司发现本站内容信息存在侵权行为,请邮件告知! 858582#qq.com
桃源资源网 Design By www.nqtax.com
暂无“JS定时关闭窗口的实例”评论...