网页左右上下浮动广告代码制作

时间:2010-03-31 17:47:02  来源:第二电脑网  作者:第二电脑网

  第二电脑网导读:var collection; XE2,pjZ  function floaters() { !2:B71@D  this.items = []; iZ,6ntT  this.addItem = function(id,x,y,content) V|*DkS$&  { "$e,#6i  document.write(' '+content+''); okxi `M$A   ] "  var newItem = {}; ~Wg>H>/[  newIte...
  正文:1、在网页中加入 表示调用当前目录下的js目录下的t.js 2、用记事本建立1.js 并保存到js目录下 并把后缀名从txt改名为js   w4:C63)  
t.js内容如下   $QZ ZEr  
zU-Vpg~XL  
var delta=0.15 nvOV-`W2+s  
var collection; XE2,pjZ  
function floaters() { !2:B71@D  
this.items = []; iZ,6ntT  
this.addItem = function(id,x,y,content) V|*DkS$&  
{ "$e,#6i  
document.write(' '+content+''); okxi `M$A  
 ] "  
var newItem = {}; ~Wg>H>/[  
newItem.object = document.getElementById(id); Lg :/9b*  
newItem.x = x; 2%D^>`  
newItem.y = y; O&e}lvJ  
#E`iFGJ6d2  
this.items[this.items.length] = newItem; uAT9go  
} FQ'Fv/cS/  
this.play = function() A2NgOr_  
{ Q dc:ft?  
collection = this.items Og|&'  
setInterval('play()',10); %Cx9T(  
} t&Xgt8*  
} 6[wbk uc  
function play() +K|dzu(lr  
{ fSP7l6  
Fp_#N}  
for(var i=0;i 
{ iY`k,9h5  
var followObj = collection.object; cx VIV_K,  
var followObj_x = (typeof(collection.x)=='string'?eval(collection.x):collection.x); YBKv2s{~&*  
var followObj_y = (typeof(collection.y)=='string'?eval(collection.y):collection.y); h7] {6pc3  
H+La7b69  
if(followObj.offsetLeft!=(document.body.scrollLeft+followObj_x)) { }$~mXd)mT  
var dx=(document.body.scrollLeft+followObj_x-followObj.offsetLeft)*delta; x)Q|ye ?@2  
dx=(dx>0?1:-1)*Math.ceil(Math.abs(dx));  "网页左右上下浮动广告代码制作"由第二电脑网原创提供,转载请注明:http://www.002pc.com/master/College/Programming/JavaScript/13428.html


关键字:

关于《网页左右上下浮动广告代码制作》文章的评论

站内搜索: 高级搜索

热门搜索: Windows style 系统 tr IP QQ CPU 安装 function 注册 if td