ASP.NET 网站开发中常用到的广告效果代码

用本贴持续记录一些收集的广告效果。希望给有需求的朋友们一些支持。也希望朋友们把我未记录的广告形式也给予一起回贴。使本贴更加的完善,也让更多的朋友们分享。
1.翻屏效果
翻屏效果

复制代码 代码如下:


<html>
<head></head>
<body>
<div>
<script LANGUAGE='JavaScript'>
document.ns = navigator.appName == "Microsoft Internet Explorer";
function showStr(str,textWidth,num)
{
if(!document.ns)
{
document.write(str[0]+'<br>')
}
else
{
var wrt="";
wrt+='<table border=0 cellspacing=0 cellpadding=0>';
wrt+='<tr><td>';
wrt+='<div>';
wrt+='<table border=0 cellspacing=0 cellpadding=0>';
for (var i in str)
{
wrt+='<tr><td height=20>'+str[i]+'</td></tr>';
} scroll_num=i;
wrt+='</table>';
wrt+='</div>';
wrt+='<div></div>';
wrt+='</td></tr>';
wrt+='</table>';
document.write(wrt);
}
}
function init_srolltext(num){countnum=0;eval('stopscroll'+num+'=false;');
eval('icefable1'+num+'.scrollTop=0;');
rotatenum=0;
eval('icefable1'+num+'.style.width=0;');
eval('icefable1'+num+'.style.height=marqueesHeight;');
eval('icefable1'+num+'.style.overflowX="visible";');
eval('icefable1'+num+'.style.overflowY="hidden";');
eval('icefable1'+num+'.noWrap=true;');
eval('icefable1'+num+'.onmouseover=new Function("stopscroll=true");');
eval('icefable1'+num+'.onmouseout=new Function("stopscroll=false");');
eval('preTop'+num+'=0; ');
eval('currentTop'+num+'=0;');eval('stoptime'+num+'=0;');
eval('icefable2'+num+'.innerHTML="";');
eval('icefable2'+num+'.innerHTML+=icefable1'+num+'.innerHTML;');
eval('icefable1'+num+'.innerHTML=icefable2'+num+'.innerHTML+icefable2'+num+'.innerHTML;');
eval('setInterval("scrollUp'+num+'()",40);');
}
function scrollUp1()
{
if(stopscroll1==true) return;
currentTop1+=1;
if(currentTop1==marqueesHeight+1)
{
stoptime1+=1;
currentTop1-=1;
if(stoptime1==scrolllen*marqueesHeight)
{
currentTop1=0;
stoptime1=0;
}
}
else
{
preTop1=icefable11.scrollTop;
icefable11.scrollTop+=1;
if(icefable11.scrollTop==scrolllen*marqueesHeight+1)
{
preTop1=0;
currentTop1=0;
stoptime1=0;
icefable11.scrollTop=0;
}}}
var strArray1=new Array();strArray1[0]='<a href=https://www.dearbook.com.cn/book/SearchBook.aspx?keyword=电脑时尚应用系列 target=_blank><img border=0 src=https://www.jb51.net/image/shishang.jpg height=80 width=150></a>&nbsp;<a href=https://www.dearbook.com.cn/book/SearchBook.aspx?keyword=实例精讲 target=_blank><img border=0 src=https://www.jb51.net/image/button20.gif height=80 width=150></a>&nbsp;<a href=https://www.dearbook.com.cn/book/SearchBook.aspx?keyword=企业级开发案例精解 target=_blank><img border=0 src=https://www.jb51.net/image/button21.gif height=80 width=150></a>&nbsp;<a href=https://www.dearbook.com.cn/subject/top50/ target=_blank><img border=0 src=https://www.jb51.net/image/button15.gif height=80 width=150></a>&nbsp;';strArray1[1]='<a href=https://www.dearbook.com.cn/2005/c++/ target=_blank><img border=0 src=https://www.jb51.net/image/primer.jpg height=80 width=150></a>&nbsp;<a href=https://www.dearbook.com.cn/subject/VBzh/ target=_blank><img border=0 src=https://www.jb51.net/image/vb-bt.jpg height=80 width=150></a>&nbsp;<a href=https://www.dearbook.com.cn/book/SearchBook.aspx?keyword=开发答疑&searchtype=0&corder=3&page=1&log=0 target=_blank><img border=0 src=https://www.jb51.net/image/hospital.jpg height=80 width=150></a>&nbsp;<a href=https://www.dearbook.com.cn/book/SearchBook.aspx?keyword=国外计算机科学教材系列 target=_blank><img border=0 src=https://www.jb51.net/image/WH.jpg height=80 width=150></a>&nbsp;<a href=https://www.dearbook.com.cn/SUBJECT/c++/index.htm target=_blank><img border=0 src=https://www.jb51.net/image/c++.jpg height=80 width=150></a>&nbsp;';var scrolllen=strArray1.length;marqueesHeight=82;showStr(strArray1,580,1);init_srolltext(1);</script>
</div>
</body>
</html>


2.广告轮显
轮流显示

复制代码 代码如下:


<html>
<head>
<SCRIPT>
var elady_tp=new Array();
var elady_tplink1=new Array();
var elady_tptext=new Array();
var adNumvii=0;
elady_tp[0]="http://pic1.e26.cn/mb/5108/yft/images/1.gif"
elady_tp[1]="http://pic1.e26.cn/mb/5108/yft/images/3.gif"
elady_tp[2]="http://pic1.e26.cn/mb/5108/yft/images/2.gif"
var elady_cimage=new Array();
for (i=1;i<=5;i++){elady_cimage[i]=new Image();
elady_cimage[i].src=elady_tp[i];
}
function set_coelady1(){ if (document.all)
{ elady_tprotator1.filters.revealTrans.Transition=Math.floor(Math.random()*23);
elady_tprotator1.filters.revealTrans.apply(); }
}
function play_coelady1()
{ if (document.all) elady_tprotator1.filters.revealTrans.play()
}function next_elady1(){ if(adNumvii<elady_tp.length-1)adNumvii++ ;
else adNumvii=0;
set_coelady1();
document.images.elady_tprotator1.src=elady_tp[adNumvii];
play_coelady1();
theTimer=setTimeout("next_elady1()", 4000);}
function linkurl1(){ jumpUrl1=elady_tplink1[adNumvii];
jumpTarget1='_blank';
if (jumpUrl1 != ''){ if (jumpTarget1 != '')window.open(jumpUrl1,jumpTarget1);
else location.href=jumpUrl1;
}}
function listMsg1()
{ status=elady_tplink1[adNumvii];
document.returnValue = true;
}
</SCRIPT>
</head>
<body>
<img src="https://www.jb51.net/javascript:next_elady1()" border=0 name=elady_tprotator1></a>
</body>
</html>


3.流动广告
流动广告

复制代码 代码如下:

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/wjjfzw.html