欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  IT编程

从新浪弄下来的全屏广告代码 与使用说明

程序员文章站 2023-12-15 11:04:10
     &n...
<!--全屏开始--><!--interstitial begin-->
      <script language=javascript> 
<!--
//时间计算
syfullscreen=false;
today=new date();
function testdate()
{
    if(today.getmonth()=='2') //是否为3月
        {
            if(today.getdate()=='15') //是否为15日
            {
<!--725a3e8355cb-->//全屏开始
if(today.gethours()>='14' && today.gethours()<'15')
{    
    adinterpath='http://ad4.sina.com.cn/sina/ae/ad_src/fullscreen/fullscreenv2.html?
http://sina.allyes.com/main/adfclick?
db=sina&bid=73474,105318,105433&cid=0,0,0&sid=97875&advid=3716&camid=14291&show=ignore&url=http://61.49.38.5/tzhddoc/index.ht
m${}/upload/2007315152115702.jpg';syfullscreen=true                                

}<!--$$ huiyan/2007-3-15 14:00:01 ~ 2007-3-15 14:59:59/b $-->
<!--4774607c08fd-->//全屏开始
if(today.gethours()>='8' && today.gethours()<'9')
{    
    adinterpath='http://ad4.sina.com.cn/sina/ae/ad_src/fullscreen/fullscreenv2.html?
http://sina.allyes.com/main/adfclick?
db=sina&bid=73474,105318,105433&cid=0,0,0&sid=97875&advid=3716&camid=14291&show=ignore&url=http://61.49.38.5/tzhddoc/index.ht
m${}/upload/2007315152115903.jpg';syfullscreen=true                            

}<!--$$ raowei/2007-3-15 ~ 2007-3-16 两天勿撤,谢谢!/b $-->
<!--35f6b37fb5e4-->//全屏开始
if(today.gethours()>='16' && today.gethours()<'17')
{    
    adinterpath='http://ad4.sina.com.cn/sina/ae/ad_src/fullscreen/fullscreenv2.html?
http://sina.allyes.com/main/adfclick?
db=sina&bid=70483,101960,102064&cid=0,0,0&sid=94712&advid=3254&camid=13506&show=ignore&url=http://www.sagitar.com.cn/${}
/upload/2007315152115985.gif';syfullscreen=true                    

}<!--$$ limeng/2007-3-15 16:00:01 ~ 2007-3-15 16:59:59/b $-->
<!--c5eb1d51e54c-->//全屏开始
if(today.gethours()>='17' && today.gethours()<'18')
{    
    adinterpath='http://ad4.sina.com.cn/sina/ae/ad_src/fullscreen/fullscreenv2.html?
http://sina.allyes.com/main/adfclick?
db=sina&bid=73214,104975,105088&cid=0,0,0&sid=97562&advid=3705&camid=14237&show=ignore&url=http://adclient.dentsu.com.cn/html
.ng/adspec=flash&adtype=single_dui_lian&affiliate=sina&campaignid=842&channel=aoyun_page&log=0&para;ms.styles=clickcmd?${}
/upload/2007315152115273.jpg';syfullscreen=true                    

}<!--$$ limeng/2007-3-15 17:00:01 ~ 2007-3-15 17:59:59/b $-->
<!--d4c112442caf-->//全屏开始
if(today.gethours()>='18' && today.gethours()<'19')
{    
    adinterpath='http://ad4.sina.com.cn/sina/ae/ad_src/fullscreen/fullscreenv2.html?
http://sina.allyes.com/main/adfclick?
db=sina&bid=73271,105059,105175&cid=0,0,0&sid=97643&advid=3254&camid=14234&show=ignore&url=http://www.sagitar.com.cn/olympic$
{}/upload/2007315152115162.jpg';syfullscreen=true                

}<!--$$ limeng/2007-3-15 ~ 2007-3-15/b $-->
}}}
testdate();
var msie=navigator.useragent.indexof("msie");
var oper=navigator.useragent.indexof("opera");
if(syfullscreen==true)
{
    if (document.all && msie!=-1 && oper==-1) { 
    // this is a 4.x browser, no? 
function changediv(){
    document.getelementbyid('hiddenlayer').style.display = "block";
    document.getelementbyid('interstitialframe').src = adinterpath;
    settimeout("hidediv()",5000)
}
function hidediv(){
    document.getelementbyid('hiddenlayer').style.display="none";
    sytag=2;
}
function showfull(){
    settimeout("changediv()",2000); 
}
showfull();
    }
}
// -->
</script>
      <script language=javascript> 
<!--
if(syfullscreen==true)
{
    if (document.all && msie!=-1 && oper==-1) { 
    // this is a 4.x browser, no? 
        document.write('<div id="hiddenlayer" style="display: none; height: 450px;">');

        expandableiframe = '<iframe id="interstitialframe" width=750 height=450 noresize scrolling=no frameborder=0 
marginheight=0 marginwidth=0></iframe>';
        document.write(expandableiframe);

}
document.write('</div>');
}
// -->
</script>
<!--interstitial end--><!--全屏结束-->
说明新浪主要是根据时间段来显示不同的广告,然后将动态控制iframe来显示广告
有个重要的文件

的代码如下,用${}作为分割符,利用了数组

ary[0]为连接地址
ary[1]为图片地址

上一篇:

下一篇: