對(duì)聯(lián)廣告js flash激活
更新時(shí)間:2006年10月19日 00:00:00 作者:
ad.js
復(fù)制代碼 代碼如下:
var delta=0.08
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()
{
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',80,'<EMBED src=images/duilian.swf quality=high WIDTH=100 HEIGHT=300 TYPE=application/x-shockwave-flash id=ad wmode=opaque></EMBED>');
//左面
theFloaters.addItem('followDiv2',6,80,'<EMBED src=images/duilian.swf quality=high WIDTH=100 HEIGHT=300 TYPE=application/x-shockwave-flash id=ad wmode=opaque></EMBED>');
theFloaters.play();
//圖片格式調(diào)用方法
//<a href=http://www.makewing.com/lanren/ target=_blank><img src=images/ad_100x300.jpg border=0></a>
您可能感興趣的文章:
- 用javascript實(shí)現(xiàn)的仿Flash廣告圖片輪換效果
- 基于javascript實(shí)現(xiàn)全屏漂浮廣告
- JavaScript仿商城實(shí)現(xiàn)圖片廣告輪播實(shí)例代碼
- JS實(shí)現(xiàn)可關(guān)閉的對(duì)聯(lián)廣告效果代碼
- JavaScript實(shí)現(xiàn)的多個(gè)圖片廣告交替顯示效果代碼
- js實(shí)現(xiàn)網(wǎng)站最上邊可關(guān)閉的浮動(dòng)廣告條代碼
- js實(shí)現(xiàn)拉幕效果的廣告代碼
- JS實(shí)現(xiàn)彈性漂浮效果的廣告代碼
- js漂浮廣告實(shí)現(xiàn)代碼
- flash+jQuery實(shí)現(xiàn)可關(guān)閉及重復(fù)播放的壓頂廣告
- 基于jQuery的仿flash的廣告輪播
- js+flash實(shí)現(xiàn)的5圖變換效果廣告代碼(附演示與demo源碼下載)
相關(guān)文章
超級(jí)24小時(shí)彈窗代碼 24小時(shí)退出彈窗代碼 100%彈窗代碼(IE only)
Javascript 超級(jí)彈窗代碼 24小時(shí)彈窗代碼 24小時(shí)退出彈窗代碼 100%彈窗代碼2010-06-06
IE中實(shí)現(xiàn)全屏廣告代碼,霸道無(wú)比.
IE中實(shí)現(xiàn)全屏廣告代碼,霸道無(wú)比....2006-12-12
右下角廣告腳本之家出品(點(diǎn)擊廣告后出現(xiàn)關(guān)閉按鈕可關(guān)閉)
只有當(dāng)用戶(hù)點(diǎn)擊的廣告后,才會(huì)出現(xiàn)關(guān)閉按鈕,大家也許能用的到2008-12-12
仿百度聯(lián)盟對(duì)聯(lián)廣告實(shí)現(xiàn)代碼
仿百度聯(lián)盟對(duì)聯(lián)廣告源代碼展示,主要使用現(xiàn)代瀏覽器都支持的position:fixed屬性,并專(zhuān)門(mén)針對(duì)ie6做了最大限度的兼容性處理2014-08-08

