news.sina.com.cn首页打开产生一张大幅广告效果页面 2000毫秒后消失效果
公司下载站需要这样的效果
制作完成 源码提供出来大家一起分享
首先制作 AD.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()",5000) //5000为毫秒 是页面停留的时间间隔 你可以设定适当的数字
}
function hidediv()
{
document.getElementById('hiddenLayer').style.display="none";
SYtag=2;
}
function showfull()
{
setTimeout("changediv()",2000);
}
showfull()
然后在你想添加这样效果的页面适当的地方增加如下代码
<script language="JavaScript">
<!--
SYfullscreen=true
var adInterPath="http://xu-ni.net/news/index.asp" //这里显示的是你的广告页面 最好是单独的FLASH或者图片 你可以设定连接连接到别的页面上
if (document.all) {
// this is a 4.x browser, no?
document.write('<SCRI' + 'PT LANGUAGE="javascript1.2"');
document.writeln(' SRC="ad.js"></SCR' + 'IPT>');
}
// -->
</script>
<DIV ID="hiddenLayer" style="display: none; height: 450px;">
<script language="Javascript">
<!--
if (getsGlu) {
expandableIframe = '<IFRAME id="interstitialframe" width=750 HEIGHT=450 NORESIZE SCROLLING=No FRAMEBORDER=0 MARGINHEIGHT=0 MARGINWIDTH=0></IFRAME>';
document.write(expandableIframe); //宽度和高度不需要解释了吧
}
// -->
</script>