首页 > 编程 > .NET > 正文

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

2024-07-10 12:42:15
字体:
来源:转载
供稿:网友
用本贴持续记录一些收集的广告效果。希望给有需求的朋友们一些支持。也希望朋友们把我未记录的广告形式也给予一起回贴。使本贴更加的完善,也让更多的朋友们分享。
1.翻屏效果
翻屏效果
代码如下:
<html>
<head></head>
<body>
<div style="HEIGHT:85px">
<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 id="icefable1'+num+'">';
wrt+='<table width='+textWidth+' 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 id="icefable2'+num+'" style="position:absolute;z-index:1;visibility:hidden"></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=http://www.dearbook.com.cn/book/SearchBook.aspx?keyword=电脑时尚应用系列 target=_blank><img border=0 src=/image/shishang.jpg height=80 width=150></a> <a href=http://www.dearbook.com.cn/book/SearchBook.aspx?keyword=实例精讲 target=_blank><img border=0 src=/image/button20.gif height=80 width=150></a> <a href=http://www.dearbook.com.cn/book/SearchBook.aspx?keyword=企业级开发案例精解 target=_blank><img border=0 src=/image/button21.gif height=80 width=150></a> <a href=http://www.dearbook.com.cn/subject/top50/ target=_blank><img border=0 src=/image/button15.gif height=80 width=150></a> ';strArray1[1]='<a href=http://www.dearbook.com.cn/2005/c++/ target=_blank><img border=0 src=/image/primer.jpg height=80 width=150></a> <a href=http://www.dearbook.com.cn/subject/VBzh/ target=_blank><img border=0 src=/image/vb-bt.jpg height=80 width=150></a> <a href=http://www.dearbook.com.cn/book/SearchBook.aspx?keyword=开发答疑&searchtype=0&corder=3&page=1&log=0 target=_blank><img border=0 src=/image/hospital.jpg height=80 width=150></a> <a href=http://www.dearbook.com.cn/book/SearchBook.aspx?keyword=国外计算机科学教材系列 target=_blank><img border=0 src=/image/WH.jpg height=80 width=150></a> <a href=http://www.dearbook.com.cn/SUBJECT/c++/index.htm target=_blank><img border=0 src=/image/c++.jpg height=80 width=150></a> ';var scrolllen=strArray1.length;marqueesHeight=82;showStr(strArray1,580,1);init_srolltext(1);</script>
发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表