站长必须要知道的javascript广告代码 原创
参考了sina的代码,想出来的一个代码,请大家使用,不要传播,转载请注明:来自移动技术网
<!--
//时间计算
var showit=false;
var today=new date();
var urlpath;
function testdate()
{
urlpath='http://www.scripthome.net/bbs';showit=true
if(today.gethours()>='10' && today.gethours()<'12')
{
urlpath='https://www.jb51.net';showit=true
}
}
testdate();
var msie=navigator.useragent.indexof("msie");
var oper=navigator.useragent.indexof("opera");
if(showit==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 = urlpath;
settimeout("hidediv()",5000)
}
function hidediv(){
document.getelementbyid('hiddenlayer').style.display="none";
sytag=2;
}
function showfull(){
settimeout("changediv()",2000);
}
showfull();
}}
if(showit==true)
{
if (document.all && msie!=-1 && oper==-1) {
// this is a 4.x browser, no?
document.write('<div id="hiddenlayer" style="display: none; height: 0">');
expandableiframe = '<iframe id="interstitialframe" width=0 height=0 noresize scrolling=no frameborder=0 marginheight=0 marginwidth=0></iframe>';
document.write(expandableiframe);
}
document.write('</div>');
}
// -->
如对本文有疑问,
点击进行留言回复!!
网友评论