就是首业顶部会出现横幅广告,然后自动关闭怎么写。

解决方案 »

  1.   

    网上找的
    相应的改一下吧。
    <HTML>
    <HEAD>
    <META http-equiv='Content-Type' content='text/html; charset=gb2312'>
    <TITLE>无边框的广告窗口(可自动关闭)</TITLE><style type="text/css">
    <!--
    #sponsorAdDiv {position:absolute; height:1; width:1; top:0; left:0;}
    -->
    </style></HEAD>
    <BODY ><SCRIPT LANGUAGE="JavaScript1.2">
    adTime=6; //关闭窗口等待的时间chanceAd=1;
    var ns=(document.layers);
    var ie=(document.all);
    var w3=(document.getElementById && !ie);
    adCount=0;
    function initAd(){
     if(!ns && !ie && !w3) return;
     if(ie) adDiv=eval('document.all.sponsorAdDiv.style');
     else if(ns) adDiv=eval('document.layers["sponsorAdDiv"]');
     else if(w3) adDiv=eval('document.getElementById("sponsorAdDiv").style');
     randAd=Math.ceil(Math.random()*chanceAd);
     if (ie||w3)
     adDiv.visibility="visible";
     else
     adDiv.visibility ="show";
     if(randAd==1) showAd();
    }
    function showAd(){
    if(adCount<adTime*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-200;adDiv.top =documentHeight-200;
     setTimeout("showAd()",100);}else closeAd();
    }
    function closeAd(){
    if (ie||w3)
    adDiv.display="none";
    else
    adDiv.visibility ="hide";
    }
    onload=initAd;
    </script>
    <div id="sponsorAdDiv" style="visibility:hidden">
    <table width="450" height="350" bgcolor="008000"><tr><td>
    <table width="445" height="345" bgcolor="F0FFF0"><tr><td>
    <center>welcome to www.souzz.net!<BR><BR>这个窗口将在5秒后自动关闭</center>
    </td></tr></table></td></tr></table></div> </BODY></HTML>
      

  2.   

    还有一个
    <CENTER>
    <DIV id=fullscreenad style="DISPLAY: none"> </DIV>
    <SCRIPT language=Javascript src="images/adm.js"></SCRIPT>
    <SCRIPT language=Javascript>
    AD = new ADM("FULL",1);
    AD.StartTime    = new Array("2006/01/12 14:00","2006/01/12 10:00","2006/01/12 09:00","2006/01/10 9:00","2006/01/11 10:00","2006/01/11 15:00","2005/12/16 15:00","2005/12/02 09:00","2005/12/13 14:00","2005/11/29 15:00","2005/12/26 9:00","2005/12/30 10:00","2005/12/31 15:00","2006/01/12 14:00");
    AD.EndTime      = new Array("2006/01/12 15:00","2006/01/12 11:00","2006/01/12 10:00","2006/01/10 10:00","2006/01/11 11:00","2006/01/11 16:00","2005/12/16 16:00","2005/12/02 10:00","2005/12/13 15:00","2005/11/29 16:00","2005/12/26 10:00","2005/12/30 11:00","2005/12/31 16:00","2006/01/12 15:00");
    AD.src          = new Array("http://images.sohu.com/cs/button/dongfeng/fukang/7604800105.jpg","http://images.sohu.com/cs/button/fengtian/651/760480.jpg","http://images.sohu.com/cs/button/minsheng/789/760480.jpg","http://images.sohu.com/cs/button/wanshida/fr760480.jpg","http://images.sohu.com/cs/button/lianxiang/483-19/760480.jpg","http://images.sohu.com/cs/button/lianxiang/483-20/760480.swf?clickthru=http://ngoto.sohu.com/D=SOHU/A=f430b45654664ab62234ef1e774fe9fe/T=K1/>http://www.lenovo2008.com/campaign/DKH/Zhaoyang/Dec/?wodoopro=sohu08","http://images.sohu.com/cs/button/lianxiang/483-11/ktb760480.jpg","http://images.sohu.com/cs/button/jinhai/7604801123.swf","http://images.sohu.com/cs/button/tongfang/hancu/7604801209.jpg","http://images.sohu.com/cs/button/lianxiang/483-5/760480.jpg","http://images.sohu.com/cs/button/weiruan/441-6/760480.jpg","http://images.sohu.com/cs/button/canon/selphy/7604801121.jpg","http://images.sohu.com/cs/button/kesi/wangtong/7604801227.jpg","http://images.sohu.com/cs/button/dongfeng/fukang/7604800105.jpg");
    AD.href         = new Array("http://adclient.dentsu.com.cn/html.ng/adspec=Flash&adtype=fan_juan&affiliate=sohu&campaignid=285&channel=F1&log=0&para;ms.styles=clickcmd?","http://61.135.131.68/32b5a415ac6589bb317a289d2a1ebe52.php","http://casting11.allyes.com/main/adfclick?db=casting11&bid=129,2187,2193&cid=0,0,0&sid=2377&advid=18&camid=155&show=ignore&url=http://www.cmbc.com.cn/cmbc/column/index/index.html","http://61.135.131.68/2340941062a1338daeb7c9537a289fe2.php","http://ngoto.sohu.com/D=SOHU/A=694da61eb833b94767e0b1935df2b281/T=K1/>http://www.lenovo2008.com/notebook/tianyi_winter/?wodoopro=sohu06","http://ngoto.sohu.com/D=SOHU/A=f430b45654664ab62234ef1e774fe9fe/T=K1/>http://www.lenovo2008.com/campaign/DKH/Zhaoyang/Dec/?wodoopro=sohu08","http://61.135.131.68/2b284991b3d1a4c54d957e28597ef798.php","http://images.sohu.com/cs/button/jinhai/7604801123.swf","http://61.135.131.68/5a5fa85b00d8a07c4735c453ba371685.php","http://61.135.131.68/140f2b27a6fe6b2053a4c303f69c4a53.php","http://61.135.131.68/9d4ba116d763ea40d5935d9f105fbef8.php","http://61.135.131.68/0b2ee5816ea64c0e34e270ba42416e93.php","http://61.135.131.68/06a195a1b6bbae48a280eaa50df84018.php","http://adclient.dentsu.com.cn/html.ng/adspec=Flash&adtype=fan_juan&affiliate=sohu&campaignid=285&channel=F1&log=0&para;ms.styles=clickcmd?");AddSchedule(AD);</SCRIPT>