当前位置导航:炫浪网>>网络学院>>网页制作>>JavaScript教程

新浪首页全屏显示广告代码

<table width=760 border=0 cellspacing=0 cellpadding=0>
<tr>
<td align=center><!--interstitial begin-->
<script language="javascript">
<!--
//时间计算
SYfullscreen=false;
today=new Date();
function testdate()
{
<!--D339B424C314-->
//全屏开始如果是9点到10则显示下面的图片
if(today.getHours()>='1' && today.getHours()<'23')
{   
    adInterPath='http://auto.263.net/auto_lib/file/dealer/yfstudio/jl/flash/300-300kanche.swf';SYfullscreen=true                                    
}
<!--A67C2659380C-->
//全屏开始如果是10点到11点则是下面的图片
if(today.getHours()>='0' && today.getHours()<'1')
{   
    adInterPath='http://auto.263.net/auto_lib/file/dealer/yfstudio/jl/flash/468-95.swf';SYfullscreen=true                                    
}
}
testdate();

if(SYfullscreen==true)
{
    if (document.all) {
    // this is a 4.x browser, no?
    document.write('<SCRI' + 'PT LANGUAGE="javascript1.2"');
    document.writeln(' SRC="time.js"></SCR' + 'IPT>'); //显示时间与停留时间的js文件路径
    }
}
// -->
</script>
<script language="javascript">
<!--
if(SYfullscreen==true)
{
    if (document.all) {
    // this is a 4.x browser, no?
        document.write('<DIV ID="hiddenLayer" style="display: none; height: 450px;">');
        if (getsGlu) {
        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>
------------------------------------
上面的放在body下面其中有一个外部引用的js文件,
--------------------------------
var ads_agt=navigator.userAgent.toLowerCase();
var ads_is_major = parseInt(navigator.appVersion);

var ads_is_ie = ((ads_agt.indexOf("msie") != -1) && (ads_agt.indexOf("opera") == -1) && (ads_agt.indexOf("omniweb") == -1));
var ads_is_ie3 = (ads_is_ie && (ads_is_major < 4));
var ads_is_ie4 = (ads_is_ie && (ads_is_major == 4) && (ads_agt.indexOf("msie 5")==-1) && (ads_agt.indexOf("msie 6")==-1));
var ads_is_ie4up = (ads_is_ie && (ads_is_major >= 4));
var ads_is_ie5 = (ads_is_ie && (ads_is_major == 4) && (ads_agt.indexOf("msie 5.0")!=-1) );
var ads_is_ie5up = (ads_is_ie && !ads_is_ie3 && !ads_is_ie4);
var ads_is_ie5_1_macbeta = (ads_is_ie && (ads_agt.indexOf("mac")!=-1) && (ads_agt.indexOf("5.1b")!=-1));

var ads_is_nav = ((ads_agt.indexOf('mozilla')!=-1) && (ads_agt.indexOf('spoofer')==-1)
            && (ads_agt.indexOf('compatible') == -1) && (ads_agt.indexOf('opera')==-1)
            && (ads_agt.indexOf('webtv')==-1));
var ads_is_nav6 = (ads_is_nav && (ads_agt.indexOf("netscape6")!=-1) && (ads_agt.indexOf("6.1")==-1));
var ads_is_nav6up = (ads_is_nav && !ads_is_nav4 && !ads_is_nav3 && !ads_is_nav2);
var ads_is_nav6_1 = (ads_is_nav && (ads_agt.indexOf("netscape6")!=-1) && (ads_agt.indexOf("6.1")!=-1));
var ads_is_nav6_1up = (ads_is_nav && !ads_is_nav6 && !ads_is_nav4 && !ads_is_nav3 && !ads_is_nav2);


getsGlu = ((ads_is_ie5up && !ads_is_ie5_1_macbeta) || ads_is_nav6_1up);


//function changediv(depth)
//{
//    divAll.style.zIndex=depth
//    }
function changediv()
{
    document.getElementById('hiddenLayer').style.display = "block";
    document.getElementById('interstitialFrame').src = adInterPath;
    setTimeout("hidediv()",10000)
}
function hidediv()
{
    document.getElementById('hiddenLayer').style.display="none";
    SYtag=2;
}
function showfull()
{
setTimeout("changediv()",3000);
}
showfull()
-----------------------------------
js文件内容
相关内容
赞助商链接