兄弟姐妹..急..关于右键菜单问题..

cror101 2007-08-29 02:58:43
我在有连接的图片上做了一个右键菜单,
<img src="image/23.JPG" width="104" height="102" border="0" onMouseUp="setMenu(<%=rs("id")%>)">

function setMenu(cid){
if(event.button==2){
showMenu(cid);
}
}

function showMenu(cid){

var x, y, w, h, ox, oy;
x = event.clientX;
y = event.clientY;
var obj = document.getElementById("haha1");
if (obj == null)
return true;
ox = document.body.clientWidth;
oy = document.body.clientHeight;
if(x > ox || y > oy)
return false;
w = obj.offsetWidth;
h = obj.offsetHeight;
if((x + w) > ox)
x = x - w;
if((y + h) > oy)
y = y - h;

obj.style.posLeft = x + document.body.scrollLeft;
obj.style.posTop = y + document.body.scrollTop;
obj.style.visibility = "visible";
return false;
}


<div id="haha1" style="BACKGROUND-COLOR: #ffffff; BORDER: #000000 1px solid; LEFT: 0px; POSITION: absolute; TOP: 0px; VISIBILITY: hidden; Z-INDEX: 20">
<table width=12% border=0 cellspacing=0 cellpadding=0>
<tr>
<td height=10 align=center></td>
</tr>
<tr>
<td height=10 align=center>删除</td>
</tr>
</table>
</div>

请问在haha1这个层中取到cid这个值...谢谢了.
...全文
97 1 打赏 收藏 转发到动态 举报
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
kangqin 2007-08-29
  • 打赏
  • 举报
回复
将CID直接做成全局变量,那不就在页面范围内都可以读了?

87,907

社区成员

发帖
与我相关
我的任务
社区描述
Web 开发 JavaScript
社区管理员
  • JavaScript
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧