怎样在数节点时点右键出现菜单,对节点增、删、改。

Caris 2003-08-21 01:00:12
怎样在数节点时点右键出现菜单,对节点增、删、改。
...全文
77 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
pp4u 2003-08-21
  • 打赏
  • 举报
回复
我的onContextMenu='go(<%=rs("id")%>)'是加在<a herf="" ></a>中的,在<div>中我就不知道了,但程序是没有问题的。
fason 2003-08-21
  • 打赏
  • 举报
回复
<span oncontextmenu="showMenu();return(false)">
<form name=form1 method=post>
<input type="hidden" name="control">
</form>

form1.submit()
Caris 2003-08-21
  • 打赏
  • 举报
回复
在<span>中调用onmousedown方法,如何实现右键功能!
Caris 2003-08-21
  • 打赏
  • 举报
回复
我在<span>中加onContextMenu='go(<%=rs("id")%>)',没有显示,请pp4u(方便面(三天内结贴)) 指教,谢谢!
Caris 2003-08-21
  • 打赏
  • 举报
回复
如果象csdn论坛形式,在数菜单节点中操作并将值传给数据库该如何做?
pp4u 2003-08-21
  • 打赏
  • 举报
回复
<STYLE>.skin0 {
BORDER-RIGHT: black 1px solid; BORDER-TOP: black 1px solid; VISIBILITY: hidden; BORDER-LEFT: black 1px solid; WIDTH: 50px; HEIGHT:10px; CURSOR: default; LINE-HEIGHT: 1px; BORDER-BOTTOM: black 1px solid; FONT-FAMILY: Verdana; POSITION: absolute; BACKGROUND-COLOR: black; TEXT-ALIGN: left
}
.skin1 {
BORDER-RIGHT: buttonhighlight 0px outset; BORDER-TOP: buttonhighlight 0px outset; FONT-SIZE: 9pt; VISIBILITY: hidden; BORDER-LEFT: buttonhighlight 0px outset; WIDTH: 80px; HEIGHT:10px; CURSOR: default; BORDER-BOTTOM: buttonhighlight 0px outset; FONT-FAMILY: Arial, Helvetica, sans-serif; POSITION: absolute; BACKGROUND-COLOR: #000000; TEXT-ALIGN: center
}
.menuitems {
PADDING-RIGHT: 10px; PADDING-LEFT: 10px
}
</STYLE>
<SCRIPT language=JavaScript1.2>
//右键菜单
<!-- Begin
var dirid=0;
var menuskin = "skin1"; // skin0, or skin1
var display_url = 0; // Show URLs in status bar?
function showmenuie5() {
var rightedge = document.body.clientWidth-event.clientX;
var bottomedge = document.body.clientHeight-event.clientY;
if (rightedge < ie5menu.offsetWidth)
ie5menu.style.left = document.body.scrollLeft + event.clientX - ie5menu.offsetWidth;
else
ie5menu.style.left = document.body.scrollLeft + event.clientX;
if (bottomedge < ie5menu.offsetHeight)
ie5menu.style.top = document.body.scrollTop + event.clientY - ie5menu.offsetHeight;
else
ie5menu.style.top = document.body.scrollTop + event.clientY;
ie5menu.style.visibility = "visible";
return false;
}
function hidemenuie5() {
ie5menu.style.visibility = "hidden";
}
function highlightie5() {
if (event.srcElement.className == "menuitems") {
event.srcElement.style.backgroundColor = "highlight";
event.srcElement.style.color = "white";
if (display_url)
window.status = event.srcElement.url;
}
}
function lowlightie5() {
if (event.srcElement.className == "menuitems") {
event.srcElement.style.backgroundColor = "";
event.srcElement.style.color = "black";
window.status = "";
}
}
function getLight(id){//高亮度显示当前结点
var s=document.getElementsByTagName("SPAN")
var sn=document.getElementById("s"+id)
for(i=0;i<s.length;i++)if(s[i].className=='node')s[i].style.cssText="color:#000000;background-color:#f2f2f2"
sn.style.cssText="color:#000000;background-color:#ffffff;border:1 solid #999999"
}

function jumptoie5() {
if (event.srcElement.className == "menuitems") {
if (event.srcElement.getAttribute("target") != null)
window.open(event.srcElement.url, event.srcElement.getAttribute("target"));
else
window.location = event.srcElement.url;
}
}
function showfrm(){
var s_id=eval("s"+dirid);
hidemenuie5();
var name=window.prompt("请输入目录名称:","");
if (name!="" && name!=null){
document.frames['nodehref'].location.href="savedir.asp?name=" + name +"&id=" +s_id.link;//document.all.hdirid.value;
}
}
function showfrm2(){
var s_id=eval("s"+dirid);
document.frames['nodehref'].location.href="adddir2.asp?title=" + s_id.title +"&id=" +s_id.link;//document.all.hdirid.value;
}
function showfrm3(){
var s_id=eval("s"+dirid);
hidemenuie5();
var delsign = window.confirm('你确实要删除这个目录吗?');
if (delsign){
document.frames['nodehref'].location.href="savedir2.asp?delid=" +s_id.link;//document.all.hdirid.value;
}
}
function showfrm4(){
var s_id=eval("s"+dirid);
document.frames['nodehref'].location.href="dirsec.asp?title=" + s_id.title + "&dirid=" + dirid;//document.all.hdirid.value;
}

// End -->
</SCRIPT>

<DIV class=skin0 id=ie5menu onmouseover=highlightie5() style="LEFT: 280px; TOP: 28px " onclick=jumptoie5(); onmouseout=lowlightie5()>
<DIV>
<TABLE height="50" cellSpacing=1 cellPadding=0 width="98%" align=center bgColor=#000000>
<TBODY>
<TR>
<a href=# onclick="showfrm()"><TD onmouseover="this.style.backgroundColor='#999900'; this.style.cursor='hand';" onmouseout="this.style.backgroundColor='<%=Session("BodyColor")%>';" bgcolor="<%=Session("BodyColor")%>" height=10 scroll="no" onload="window.defaultStatus='00009876.4567.net';">

<CENTER><BR>新建目录<br><br></CENTER></TD></a></TR>
<TR>
<a href=# onclick="showfrm2()"><TD onmouseover="this.style.backgroundColor='#999900'; this.style.cursor='hand';" onmouseout="this.style.backgroundColor='<%=Session("BodyColor")%>';" bgcolor="<%=Session("BodyColor")%>" height=10 scroll="no" onload="window.defaultStatus='00009876.4567.net';">

<CENTER><BR>修改目录<br><br></CENTER></TD></a></TR>
<TR>
<a href=# onclick="showfrm3()"><TD onmouseover="this.style.backgroundColor='#999900'; this.style.cursor='hand';" onmouseout="this.style.backgroundColor='<%=Session("BodyColor")%>';" bgcolor="<%=Session("BodyColor")%>" height=10 scroll="no" onload="window.defaultStatus='00009876.4567.net';">

<CENTER><BR>删除目录<br><br></CENTER></TD></a></TR>
<TR>
<a href=# onclick="showfrm4()"><TD onmouseover="this.style.backgroundColor='#999900'; this.style.cursor='hand';" onmouseout="this.style.backgroundColor='<%=Session("BodyColor")%>';" bgcolor="<%=Session("BodyColor")%>" height=10 scroll="no" onload="window.defaultStatus='00009876.4567.net';">

<CENTER><BR>目录权限<br><br></CENTER></TD></a></TR>

</TBODY></TABLE></DIV></DIV>
<SCRIPT language=JavaScript1.2>

function go(id){
getLight(id);
var s_id=eval("s"+id)
ie5menu.className = menuskin;
//if(s_id.href!=''){
document.oncontextmenu = showmenuie5;
//showmenuie5();
document.body.onclick = hidemenuie5;
//}
dirid=id;
//document.oncontextmenu=hidemenuie5;
//alert(id);
//window.location="deeptree.asp";
}
</SCRIPT>

................................................................
然后在调用的地方加上
onContextMenu='go(<%=rs("id")%>)'

28,391

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

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