29、自由控制弹出窗口的时间2

29、自由控制弹出窗口的时间2

脚本说明:

第一步:把如下代码加入<head>区域中

<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 = "left=50,top=50,width=" + WIDTH + ",height=" + HEIGHT;

preview = window.open(URL, "preview", windowprops);

if (closetime) setTimeout("preview.close();", closetime*1000);

}

 

function doPopup() {

 

url = "http://www.7stk.com"; // change to your popup page URL

 

width = 267;  // width of window in pixels

height = 103; // height of window in pixels

delay = 5;    // time in seconds before popup opens

timer = setTimeout("Start(url, width, height)", delay*1000);

}

//  End -->

</script>

 

 

第二步:<body>区域中内容改为

<BODY OnLoad="doPopup();">

 

Write a comment

Comments: 0