·建站首页 ·钻石 ·繁體
您的位置: 中国建站之家 -> 网站开发设计 -> JavaScript -> 自由设定弹出窗口时间并且一天只弹一次

自由设定弹出窗口时间并且一天只弹一次

作者:jz123  来源:www.jz123.cn  发布时间:2005-10-27 2:02:29  发布人:jz123

<HTML>
<HEAD>
<META http-equiv='Content-Type' content='text/html; charset=gb2312'>
<TITLE>自由设定弹出窗口时间并且一天只弹一次</TITLE>
</HEAD>
<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.jz123.cn; // 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>

</BODY></HTML>

将本文收藏到QQ书签与更多好友分享