链接类

VML

按钮类

标题类

表单类

表格类

菜单类

窗口类

对象类

滚动条

键盘类

框架类

例子类

模拟类

日期类

色彩类

鼠标类

数学类

图片类

文字类

下拉框

样式类

游戏类

状态栏

资料类

字幕类

其它类

 ·opener状态
 ·网页宽高
 ·Popup
 ·判断是刷新还是关闭
 ·全屏显示
 ·改变对话框的大小
 ·测试窗口是否打开
 ·showModalD...
 ·窗口自动居中
 ·窗口总是在最上层
您当前位置:好素材首页 -> 网页特效 -> 窗口类
查看信息

弹出窗口只出现一次
好素材网 www.HaoSc.com 02月22日 11:49

[查看演示]  源码如下
----------------------------------------------------------
<html>
<head>
<title>Untitled Document-www.51windows.Net</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<script>
function openpopup(){
window.open("anowdo.htm","","width=300,height=300")
//自己修改弹出窗口
}
function get_cookie(Name) {
var search = Name + "="
var returnvalue = "";
if (document.cookie.length > 0) {
offset = document.cookie.indexOf(search)
if (offset != -1) {
//如果 cookie 已经存在
offset += search.length
// 设定起始的索引值
end = document.cookie.indexOf(";", offset);
// 设定结束值
if (end == -1)
end = document.cookie.length;
returnvalue=unescape(document.cookie.substring(offset, end))
}
}
return returnvalue;
}

function loadpopup(){
if (get_cookie('popped')==''){
openpopup()
document.cookie="popped=yes"
}
}

</script>

</head>

<body onload="loadpopup()">
</body>
</html>

<div style="position: absolute; top: 10; right: 10; width: 148; height: 18;cursor:hand">
<input type="button" name="Button" value="查看源代码" onClick= 'window.location = "view-source:" + window.location.href'></div>


此信息共 1 页 [1]