用本贴持续记录一些收集的广告效果。希望给有需求的朋友们一些支持。也希望朋友们把我未记录的广告形式也给予一起回贴。使本贴更加的完善,也让更多的朋友们分享。
1.翻屏效果
翻屏效果
document.ns = navigator.appName == "Microsoft Internet Explorer";
function showStr(str,textWidth,num)
{
if(!document.ns)
{
document.write(str[0]+'
')
}
else
{
var wrt="";
wrt+='
wrt+='
';wrt+='
wrt+='
for (var i in str)
{
wrt+='
'+str[i]+'';} scroll_num=i;
wrt+='
';wrt+='
wrt+='
wrt+='
';wrt+='
';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+'.οnmοuseοver=new Function("stopscroll=true");');
eval('icefable1'+num+'.οnmοuseοut=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]=' ';strArray1[1]=' ';var scrolllen=strArray1.length;marqueesHeight=82;showStr(strArray1,580,1);init_srolltext(1);
2.广告轮显
轮流显示
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
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;
}
3.流动广告流动广告
4.移动广告框
移动广告
5.左右底部广告
var MmyeeAdShow = 3; //1为左侧显示 2为右侧显示 其他为两侧显示
var MmyeeAdWidth =300; //广告宽度
var MmyeeAdHeight = 200; //广告高度
//左边浮动
var AdLeftContent= "
//右边浮动
var AdRightContent = "
//漂浮据页面底部设定框值,为了美观请不要修改次参数
var marginTop = 10
//漂浮据边框的距离
var marginLeft = 5
var navUserAgent = navigator.userAgent
function load()
{
judge();
move();
}
function move() {
judge();
setTimeout("move();",80)
}
function judge(){
if (navUserAgent.indexOf("Firefox") >= 0 || navUserAgent.indexOf("Opera") >= 0) {
if (MmyeeAdShow != "2") {
document.getElementById("adLeftFloat").style.top = (document.body.scrollTop?document.body.scrollTop:document.documentElement.scrollTop) + ((document.body.clientHeight > document.documentElement.clientHeight)?document.documentElement.clientHeight:document.body.clientHeight) - (MmyeeAdHeight) - marginTop + 'px';
}
if (MmyeeAdShow != "1") {
document.getElementById("adRightFloat").style.top = (document.body.scrollTop?document.body.scrollTop:document.documentElement.scrollTop) + ((document.body.clientHeight > document.documentElement.clientHeight)?document.documentElement.clientHeight:document.body.clientHeight) - (MmyeeAdHeight) - marginTop + 'px';
document.getElementById("adRightFloat").style.left = ((document.body.clientWidth > document.documentElement.clientWidth)?document.body.clientWidth:document.documentElement.clientWidth) - MmyeeAdWidth - marginLeft + 'px';
}
}
else{
if (MmyeeAdShow != "2") {
document.getElementById("adLeftFloat").style.top = (document.body.scrollTop?document.body.scrollTop:document.documentElement.scrollTop) + ((document.documentElement.clientHeight == 0)?document.body.clientHeight:document.documentElement.clientHeight) - (MmyeeAdHeight) - marginTop + 'px';
}
if (MmyeeAdShow != "1") {
document.getElementById("adRightFloat").style.top = (document.body.scrollTop?document.body.scrollTop:document.documentElement.scrollTop) + ((document.documentElement.clientHeight == 0)?document.body.clientHeight:document.documentElement.clientHeight) - (MmyeeAdHeight) - marginTop + 'px';
document.getElementById("adRightFloat").style.left = ((document.documentElement.clientWidth == 0)?document.body.clientWidth:document.documentElement.clientWidth) - MmyeeAdWidth - marginLeft + 'px';
}
}
if (MmyeeAdShow != "2") {
document.getElementById("adLeftFloat").style.left = marginLeft + 'px';
}
}
if (MmyeeAdShow != "2") {
document.write("
"+AdLeftContent+" |
}
if (MmyeeAdShow != "1") {
document.write("
"+AdRightContent+" |
}
load();
6.左侧浮动广告
init_Ad_Left();//载入页面后,调用函数init_Ad_Left().
加入你要放置的内容
dsfsfqqq qqqqqqqq qqqqqqqq qqqqqqqq qqqqqqqq qqqqqqqq qqqqqqqq qqqqqqqq qqqqqqqq
qqqqq qqqqqqqq qqqqqqqq qqqqqqq
7.右侧浮动广告
init_Ad_Right();//载入页面后,调用函数init_Ad_Right()
加入你要放置的内容
hhhhhh hhhhhh hh hhhhhh hhhhhh hhhhhh h hhhhhh hhhhhh hhhhhh hhhhhh hh
8.左右浮动广告
以下各层不变,在event="onload"中同时加载init_Ad_Left()和 init_Ad_Right()方法
左右浮动广告
init_Ad_Left();//载入页面后,调用函数init_Ad_Left()
init_Ad_Right();//载入页面后,调用函数init_Ad_Right()
9.falsh广告轮显
Flash广告轮显Demo
感谢好友位绰提供此广告展现样式
有兴趣的朋友还可以封装成ASP.NET里的自定义控件。这样使用更为方便。