制作弹出式窗口

  • 格式:docx
  • 大小:12.81 KB
  • 文档页数:2

1.制作弹出式窗口:在网上经常看到,当打开一个页面时,立即就弹出一个广告窗口,我们把这个广告窗口称为弹出式窗口。

其制作方法用到了Window中的Open方法。

<html>
<head>
<script language=”vbscript”>
function openwin()
setOpenWindow=window.open(“gg.htm”,”new”,”height=60,width=300,toolbar=no,status=no,me nubar=no,scrollbars=no,resizable=no”)
end function
</script>
</head>
<body onload=openwin()>
</body>
</html>
2.网页分时问候:有的网站分不同时间对来访者实行不同的问候,实现代码如下:
<script language=”vbscript”>
dim i
i=hour(time())
if i>0 and i<6 then
document .write(“凌晨好!”)
end if
if i>=6 and i<8 then
document.write(“早上好!”)
end if
if i>=8 and i<12 then
document,write(“中午好!”)
end if
if i>=12 and i<18 then
document,write(“下午好!”)
end if
if i>=18 and i>24 then
document,write(“晚上好!”)
end if
</script>
3.状态栏走马灯效果:设置浏览器状态栏中的的文字在Web页面上经常可见,下面例子将会在状态栏中显示当前时间,并一秒一秒的不间断走。

<script language=”vbscript”>
sub change()
status=”现在时间:”&time()
settimeout”change()”,1000
end sub
sub window_onload()
change end sub </script>。