站長(zhǎng)必須要知道的javascript廣告代碼 原創(chuàng)
原創(chuàng) 更新時(shí)間:2007年05月30日 00:00:00 原創(chuàng) 作者:
參考了sina的代碼,想出來(lái)的一個(gè)代碼,請(qǐng)大家使用,不要傳播,轉(zhuǎn)載請(qǐng)注明:來(lái)自腳本之家
<!--
//時(shí)間計(jì)算
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='http://www.dbjr.com.cn';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>');
}
// -->
<!--
//時(shí)間計(jì)算
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='http://www.dbjr.com.cn';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>');
}
// -->
相關(guān)文章
javascript 定時(shí)廣告顯示(兩個(gè)時(shí)間段)
今天又朋友問(wèn)我那個(gè)定時(shí)廣告,就是有一些廣告需要控制一下時(shí)間,在這一段時(shí)間內(nèi)廣告才可以顯示,下面是具體的代碼。2009-08-08用js實(shí)現(xiàn)的一個(gè)Flash滾動(dòng)輪換顯示圖片代碼生成器
用js實(shí)現(xiàn)的一個(gè)Flash滾動(dòng)輪換顯示圖片代碼生成器...2007-03-03從網(wǎng)易扒過(guò)來(lái)的js調(diào)用廣告顯示文件(隨機(jī)幾率)
從網(wǎng)易扒過(guò)來(lái)的js調(diào)用廣告顯示文件(隨機(jī)幾率),有幾率顯示,主要是靠隨機(jī)數(shù),需要的朋友可以參考下。2011-02-02js實(shí)現(xiàn)全屏漂浮廣告移入光標(biāo)停止移動(dòng)
這篇文章主要介紹了js全屏漂浮廣告移入光標(biāo)停止移動(dòng)效果,大家參考使用吧2013-12-12點(diǎn)下網(wǎng)頁(yè)的任意地方,都可到達(dá)指定頁(yè)面的js代碼
點(diǎn)下網(wǎng)頁(yè)的任意地方,都可到達(dá)指定頁(yè)面的js代碼...2007-03-03