104、自动关闭的层

104、自动关闭的层

脚本说明:

把如下代码加入<body>区域中

<SCRIPT language=JavaScript>

timePopup=5;var ns=(document.layers);var ie=(document.all);var w3=(document.getElementById && !ie);adCount=0;

function initPopup(){if(!ns && !ie && !w3) return;if(ie) adDiv=eval('document.all.lbplocation.style');else if(ns) adDiv=eval('document.layers["lbplocation"]');else if(w3) adDiv=eval('document.getElementById("lbplocation").style');if (ie||w3) adDiv.visibility="visible";else adDiv.visibility ="show";showPopup();}

function showPopup(){if(adCount<timePopup*10){adCount+=1;if (ie){documentWidth  =document.body.offsetWidth/2+document.body.scrollLeft-20;documentHeight =document.body.offsetHeight/2+document.body.scrollTop-20;} else if (ns){documentWidth=window.innerWidth/2+window.pageXOffset-20;documentHeight=window.innerHeight/2+window.pageYOffset-20;} else if (w3){documentWidth=self.innerWidth/2+window.pageXOffset-20;documentHeight=self.innerHeight/2+window.pageYOffset-20;} adDiv.left=documentWidth-250;adDiv.top =documentHeight-150; setTimeout("showPopup()",100);}else closePopup();}

function closePopup(){if (ie||w3) adDiv.display="none"; else adDiv.visibility ="hide";}

onload=initPopup;

</SCRIPT>

<DIV id=lbplocation style="HEIGHT: 1px; LEFT: 50px; POSITION: absolute; TOP: 100px; VISIBILITY: hidden; WIDTH: 1px">

            <TABLE bgColor=#35726c height=320

            style="BORDER-BOTTOM: #ecf6f5 1px outset; BORDER-LEFT: #ecf6f5 1px outset; BORDER-RIGHT: #ecf6f5 1px outset; BORDER-TOP: #ecf6f5 1px outset"

            width=520>

              <TBODY>

              <TR>

                <TD>

                  <TABLE align=center bgColor=#83c6c0 height=290

                  style="BORDER-BOTTOM: #fafdfd 1px inset; BORDER-LEFT: #fafdfd 1px inset; BORDER-RIGHT: #fafdfd 1px inset; BORDER-TOP: #fafdfd 1px inset"

                  width=490>

                    <TBODY>

                    <TR>

                      <TD align=middle vAlign=center><BR><BR><B><A

                        href="register.cgi"

                        title=按这里进行注册><U>注 册</U></A>  <A

                        href="loginout.cgi?forum=44"

                        title=从这里开始进入论坛><U>登 入</U></A></B>

                        <P>(此视窗将于 5 秒后自动关闭)</P></TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE></DIV>

Write a comment

Comments: 0