134、页面自动打开关闭

134、页面自动打开关闭

脚本说明:

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

<SCRIPT LANGUAGE="JavaScript">

<!-- Begin

function popupWin() {

text =  "<html>\n<head>\n<title>跳出窗口</title>\n<body>\n";

text += "<center>\n<br>";

text += "<a href='http://www.7stk.com' target='_blank'><h2>网页特效代码</h2></a>";

text += "</center>\n</body>\n</html>\n";

setTimeout('windowProp(text)', 3000);               // delay 3 seconds before opening

}

function windowProp(text) {

newWindow = window.open('','newWin','width=200,height=30');

newWindow.document.write(text);

setTimeout('closeWin(newWindow)', 5000); // delay 5 seconds before closing

}

function closeWin(newWindow) {

newWindow.close();                           // close small window and depart

}

//  End -->

</script>

 

 

 

第二步:把<body>中的内容改为:

<body bgcolor="#fef4d9" onLoad="popupWin()">

 

Write a comment

Comments: 0