<!-- 要实现此效果需要 2 个步骤: -->
<!-- 第 1 步: -->
<!-- 把<BODY>中的属性代码改为: -->
<BODY OnLoad="doPopup();">
<!-- 第 2 步: -->
<!-- 把下面的代码加到<BODY></BODY>区域中: -->
等3秒...
<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
closetime = 0; // Close window after __ number of seconds?
// 0 = do not close, anything else = number of seconds
function Start(URL, WIDTH, HEIGHT) {
windowprops = "menubar=no,toolbar=no,status=no,scrollbars=no,resizable=no,left=200,top=50,width=" + WIDTH + ",height=" + HEIGHT;
preview = window.open(URL, "preview",windowprops);
if (closetime) setTimeout("preview.close();", closetime*1000);
}
function get_cookie(Name) {
var search = Name + "="
var returnvalue = "";
if (document.cookie.length > 0) {
offset = document.cookie.indexOf(search)
if (offset != -1) { // if cookie exists
offset += search.length
// set index of beginning of value
end = document.cookie.indexOf(";", offset);
// set index of end of cookie value
if (end == -1)
end = document.cookie.length;
returnvalue=unescape(document.cookie.substring(offset, end))
}
}
return returnvalue;
}
function doPopup() {
url = "http://www.tc711.com"; // change to your popup page URL
width = 600; // width of window in pixels
height = 500; // height of window in pixels
delay = 3; // time in seconds before popup opens
if (get_cookie('popped')==''){
timer = setTimeout("Start(url, width, height)", delay*1000);
document.cookie="popped=yes"
}
}
// End -->
</script>
更多的自由设定弹出窗口时间并且一天只弹一次请到论坛查看: http://BBS.TC711.COM
【 双击滚屏 】 【 评论 】 【 收藏 】 【 打印 】 【 关闭 】
来源:
互联网
日期:2006-6-5