论坛: 网站建设 标题: 帮我看一下这个脚本,怎么只显示在左的对联哟 复制本贴地址    
作者: asusmlan2 [asusmlan2]    论坛用户   登录
帮我看一下这个脚本,怎么只显示在左的对联哟
脚本如下:
________________________________________________________________________________
//左边  在首页用这个命令进行调用:<script src="foot.Js"></script>哈哈
var left_img1='<iframe width=80 height=235 src="/fool/footw.htm" border=0 frameborder=0 scrolling=no></iframe>';
//右边
var right_img1='';

var delta=0.05
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','16',300,''+left_img1+'');//左图上距左距
theFloaters.addItem('followDiv3','document.body.clientWidth-106',480,''+right_img1+'');//右图上距左距
theF
_________________________________________________________________________________
经调试后只显左边的,右边的没有,

地主 发表时间: 06-10-27 09:23

回复: poemail [poemail]   论坛用户   登录
你看一下下面这行的IMG文件没有定义路径,当然不行了啊…………

//右边
var right_img1='';

单引号里面要填写地址…………路径…………


B1层 发表时间: 06-10-27 15:03

回复: asusmlan2 [asusmlan2]   论坛用户   登录
感谢啊,现在搞定了

B2层 发表时间: 06-10-28 18:06

论坛: 网站建设

20CN网络安全小组版权所有
Copyright © 2000-2010 20CN Security Group. All Rights Reserved.
论坛程序编写:NetDemon

粤ICP备05087286号