I made it Dui Lian Advertisment (对联广告)
oday, I implemented the Dui Lian Ad banner in two ways according to two articals found in Internet
*** Method 1 ***
reference: 网站对联式Flash广告源代码 http://ilovinit.idc99.cn/blogview.asp?logID=116
The artical gives detailed info about how to implement a Dui Lian Ad banner. So,it is easy to make one by user
itself. However, there is no chance for users to change the close icon on the banner and the corresponding
hyperlink, since they are hard coded in the process of producing the swf (Shockwave flash) files.
*** Method 2 ***
reference: 带关闭按钮的对联广告代码 http://www.lulu163.com/111/2005-7-207921.html
As compared, the implementation in method 2 allows users to change easily the close icon and corresponding hyperlink
NOTE: <script src=Ad.js></script> must be placed between </body> and </html>.In opposite, in method 1, it is placed
before </head>
把以下文字存成js文件,比如ad.js。然后替换代码中的SWF地址。
<!--对联代码开始lulu163.com-->
var delta=0.015;
var collection;
var closeB=false;
function floaters() {
this.items = [];
this.addItem = function(id,x,y,content)
{
document.write('<DIV id='+id+' style="Z-INDEX: 10; POSITION: absolute; width:80px; height:60px;left:'+(typeof(x)=='string'?eval(x):x)+';top:'+(typeof(y)=='string'?eval(y):y)+'">'+content+'</DIV>');
var newItem = {};
newItem.object = document.getElementById(id);
newItem.x = x;
newItem.y = y;
this.items[this.items.length] = newItem;
}
this.play = function()
{
collection = this.items
setInterval('play()',1);
}
}
function play()
{
if(screen.width<=800 || closeB)
{
for(var i=0;i<collection.length;i++)
{
collection[i].object.style.display = 'none';
}
return;
}
for(var i=0;i<collection.length;i++)
{
var followObj = collection[i].object;
var followObj_x = (typeof(collection[i].x)=='string'?eval(collection[i].x):collection[i].x);
var followObj_y = (typeof(collection[i].y)=='string'?eval(collection[i].y):collection[i].y);
if(followObj.offsetLeft!=(document.body.scrollLeft+followObj_x)) {
var dx=(document.body.scrollLeft+followObj_x-followObj.offsetLeft)*delta;
dx=(dx>0?1:-1)*Math.ceil(Math.abs(dx));
followObj.style.left=followObj.offsetLeft+dx;
}
if(followObj.offsetTop!=(document.body.scrollTop+followObj_y)) {
var dy=(document.body.scrollTop+followObj_y-followObj.offsetTop)*delta;
dy=(dy>0?1:-1)*Math.ceil(Math.abs(dy));
followObj.style.top=followObj.offsetTop+dy;
}
followObj.style.display = '';
}
}
function closeBanner()
{
closeB=true;
return;
}
var theFloaters = new floaters();
//
theFloaters.addItem('followDiv1','document.body.clientWidth-105',110,'<a onClick="closeBanner();" href=job.asp target=_blank><embed src=lu/403.swf quality=high pluginspage=http://www.macromedia.com/go/getflashplayer type=application/x-shockwave-flash height=280 width=95></embed></a><br><img src=ads/close.gif onClick="closeBanner();">');
theFloaters.addItem('followDiv2',5,110,'<a onClick="closeBanner();" href=job.asp target=_blank><embed src=lu/402.swf quality=high pluginspage=http://www.macromedia.com/go/getflashplayer type=application/x-shockwave-flash height=280 width=95></embed></a><br><img src=ads/close.gif onClick="closeBanner();">');
theFloaters.play();
<!--对联代码结束lulu163.com-->
其中ads/close.gif为关闭按钮,lu/402.swf,lu/403.swf 为FLASH地址,href=job.asp 为FLASH的链接地址。如果还有不明白的请加QQ群:2408014
本站原创,转载请注明出处!
http://www.panpan.org/newtexiao/
点图片出现隐藏连接或内容 点三次打开指定连接 新增的一批特效 新增的又一批特效 新增的再一批酷特效 永在两侧浮动的表单
背景上下雨水滴下落特效 背景上的游动的金鱼 背景上飞舞的蝴蝶 图片上飞舞的雪花 透明FLASH特效之一 透明FLASH特效之二
透明FLASH特效之三 透明FLASH特效之四 透明FLASH特效之五 透明FLASH特效之六 透明FLASH特效之七 透明FLASH特效之八
透明FLASH特效之九 透明FLASH特效之十 透明FLASH特效十一 透明FLASH特效十二 透明FLASH特效十三 永在一侧浮动的表单
圣诞节快乐(flash)
漏雨的小屋(flash)
点击鼠标出现礼花
对联式左右广告代码
两侧对联广告代码效果之二[带鼠标感应]
很好的对联广告代码
对联广告(带关闭)
对联广告3(可关闭) 背景上常青藤和叶子
字体变大小和简繁转换
http://www.blueidea.com/bbs/NewsDetail.asp?id=2130183
你这是两边都是图片的了,楼主要的是一边FLASH,一边图片呀,看看这个行不行?
var delta=0.15
var collection;
function floaters() {
this.items = [];
this.addItem = function(id,x,y,content)
{
document.write('<DIV id='+id+' style="Z-INDEX: 10; POSITION: absolute; width:80px; height:60px;left:'+(typeof(x)=='string'?eval(x):x)+';top:'+(typeof(y)=='string'?eval(y):y)+'">'+content+'</DIV>');
var newItem = {};
newItem.object = document.getElementById(id);
newItem.x = x;
newItem.y = y;
this.items[this.items.length] = newItem;
}
this.play = function()
{
collection = this.items
setInterval('play()',10);
}
}
function play()
{
if(screen.width<=800)
{
for(var i=0;i<collection.length;i++)
{
collection[i].object.style.display = 'none';
}
return;
}
for(var i=0;i<collection.length;i++)
{
var followObj = collection[i].object;
var followObj_x = (typeof(collection[i].x)=='string'?eval(collection[i].x):collection[i].x);
var followObj_y = (typeof(collection[i].y)=='string'?eval(collection[i].y):collection[i].y);
if(followObj.offsetLeft!=(document.body.scrollLeft+followObj_x)) {
var dx=(document.body.scrollLeft+followObj_x-followObj.offsetLeft)*delta;
dx=(dx>0?1:-1)*Math.ceil(Math.abs(dx));
followObj.style.left=followObj.offsetLeft+dx;
}
if(followObj.offsetTop!=(document.body.scrollTop+followObj_y)) {
var dy=(document.body.scrollTop+followObj_y-followObj.offsetTop)*delta;
dy=(dy>0?1:-1)*Math.ceil(Math.abs(dy));
followObj.style.top=followObj.offsetTop+dy;
}
followObj.style.display = '';
}
}
var theFloaters = new floaters();
theFloaters.addItem('followDiv1','document.body.clientWidth-106',102,'><a href=广告链接地址 target=_blank><img src=广告图片地址 width=100 height=400 border=0></a>');
theFloaters.addItem('followDiv2',6,102,'<object classid=clsid27CDB6E-AE6D-11cf-96B8-444553540000 codebase=http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0 width=100 height=300 id=nowad><param name=movie value=所要的广告FLASH><param name=quality value=high><<param name=wmode value=transparent><embed src=swf/ad.swf quality=high pluginspage=http://www.macromedia.com/go/getflashplayer wmode=transparent type=application/x-shockwave-flash width=100 height=300></embed></object>');
theFloaters.play();