1 function continueAdd(obj)
2 {
3 //设置显示位置
4 var left=calulateoffset(obj,"offsetLeft");
5 var top=calulateoffset(obj,"offsetTop")+obj.offsetHeight;
6 var table1=document.getElementById("table1");
7 table1.style.left=100+left+"px";
8 table1.style.top=top+"px";
9 document.all.table1.style.display="block";
10 }
11
12 //计算显示位置函数
13 function calulateoffset(field,attr)
14 {
15 var offset=0;
16 while(field)
17 {
18 offset+=field[attr];
19 field=field.offsetParent;
20 }
21 return offset;
22 }
23
记得要定义div的position 为absolute
1 <DIV id=table1 style="POSITION: absolute">
附mose变为手型:course:handle
posted on 2007-05-25 08:02
NG 阅读(764)
评论(1) 编辑 收藏 所属分类:
javascript