求助关于树形结构的右键添加节点的实现脚本请指点! 在线给分!!!!!!! 你说的范围太大了,用oncontextmenu事件和弹出菜单吧window.createPopup(); 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 ky99xing(kk):我有一棵树就是要实现当右键点击根节点时弹出右键菜单,你有现成的弹出右键菜单的例子吗? 有啊,不过连的是domino数据库的 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html><head><title>简单的例子:</title><meta http-equiv="Content-Type" content="text/html; charset=gb2312"><script language="JavaScript">var mouseRightPopupMenu = window.createPopup();var mouseRightPopupMenuBody = mouseRightPopupMenu.document.body;function ShowPopupMenu(){ window.event.cancelBubble = true; window.event.returnValue = false; mouseRightPopupMenuBody.innerHTML = "这里是菜单项"; mouseRightPopupMenu.show(window.event.x + document.body.scrollLeft, window.event.y + document.body.scrollTop, 100, 30, document.body);}</script></head><body><table border="1" cellspacing="0" cellpadding="3"> <tr> <td oncontextmenu="ShowPopupMenu();">这里点鼠标右键</td> </tr></table></body></html> 参考一下吧:document.write('<DIV ID="tips_table" style="Z-INDEX: 2;POSITION:absolute; VISIBILITY: hidden; WIDTH: 100; TOP: 260; HEIGHT: 84; left:10"></DIV>');Xoffset=0;Yoffset= 18;var IsModify=0;var yyy=-2000;xxx=-2000;var skn=tips_table.style;document.onmousemove=get_mouse;document.onclick=HiddenTip;document.oncontextmenu=stop;var licons = { 'target' : '', 'icon_e' : 'icons/0.gif', 'icon_l' : 'icons/90.gif', 'icon_2' : 'icons/91.gif', 'icon_3' : 'icons/92.gif', 'icon_18' : 'icons/93.gif', 'icon_19' : 'icons/94.gif', 'icon_26' : 'icons/95.gif', 'icon_27' : 'icons/96.gif' };var a_safemode = true;var trees = []; function RClick(FolderID) { if(event.button==2) { var TabHead='<table width="100" border="0" cellspacing="1" cellpadding="0" align="center" bgcolor="#FFFFFF">'; var mnuAddNew='<tr><td id="mnuaddnew" bgcolor="#A0B4DA" height="20" onMouseOut="mnuaddnew.style.backgroundColor="#A0B4DA";" onMouseOver="mnuaddnew.style.backgroundColor="#000000";" width="100"><img src="/inside/images/index_image/left_dot.gif" width="20" height="16" align="absbottom"><a href="javascript:MM_goToURL("parent","add_tree.asp?id='+FolderID+'&optiontype=add")" style="text-decoration: none"><font color="#FFFFFF" style="font-size: 9pt">新建目录</font></a><font color="#FFFFFF"></font></td></tr>'; var mnuModify='<tr><td id="mnumodify" bgcolor="#A0B4DA" height="20" onMouseOut="mnumodify.style.backgroundColor="#A0B4DA";" onMouseOver="mnumodify.style.backgroundColor="#000000";" width="100"><img src="/inside/images/index_image/left_dot.gif" width="20" height="16" align="absbottom"><a href="javascript:MM_goToURL("parent","edit_tree.asp?id='+FolderID+'&optiontype=edit")" style="text-decoration: none"><font style="font-size: 9pt" color="#FFFFFF">修改目录</font></a></td></tr>'; var mnuDelete='<tr><td id="mnudelete" bgcolor="#A0B4DA" height="20" onMouseOut="mnudelete.style.backgroundColor="#A0B4DA";" onMouseOver="mnudelete.style.backgroundColor="#000000";" width="100"><img src="/inside/images/index_image/left_dot.gif" width="20" height="16" align="absbottom"><a href="javascript:DeleteCustom("'+FolderID+'")" style="text-decoration: none"><font style="font-size: 9pt" color="#FFFFFF">删除目录</font></a></td></tr>'; var mnuEnd='</table>' skn.left =xxx; skn.top =yyy; if(FolderID=="") { tips_table.innerHTML=TabHead+mnuAddNew+mnuEnd; } else { tips_table.innerHTML=TabHead+mnuAddNew+mnuModify+mnuDelete+mnuEnd; } skn.visibility="visible"; } }function DHTMLSupported () { try { var tmp = ""; tmp = document.body.innerHTML; if (tmp.length <= 0) return false; } catch(e) { return false; } return true;} div移动不了 javascript获取选中的radio标签的文本内容 哪些浏览器支持 innerHTML 字符串"{id:'123',bc:'44'}"如何转化为Object 分享一个定位焦点光标的代码,我很少雷锋的。。。 如何在.hta程序中生成一个WScript对象 载入页面时不能自动播放。JS代码有问题吗? 如何使用文本输入框的readonly属性!在线等... 如何判断当前复选框(有多个同名的复选框)有没有没选中? 为什么不能弹出一个小窗口 请问如何用javascript和xml实现查询sql server数据库的功能? style的显示隐藏的问题?简单
<html>
<head>
<title>简单的例子:</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<script language="JavaScript">
var mouseRightPopupMenu = window.createPopup();
var mouseRightPopupMenuBody = mouseRightPopupMenu.document.body;
function ShowPopupMenu()
{
window.event.cancelBubble = true;
window.event.returnValue = false;
mouseRightPopupMenuBody.innerHTML = "这里是菜单项";
mouseRightPopupMenu.show(window.event.x + document.body.scrollLeft,
window.event.y + document.body.scrollTop,
100, 30,
document.body);
}
</script>
</head><body>
<table border="1" cellspacing="0" cellpadding="3">
<tr>
<td oncontextmenu="ShowPopupMenu();">这里点鼠标右键</td>
</tr>
</table>
</body>
</html>
document.write('<DIV ID="tips_table" style="Z-INDEX: 2;POSITION:absolute; VISIBILITY: hidden; WIDTH: 100; TOP: 260; HEIGHT: 84; left:10"></DIV>');
Xoffset=0;
Yoffset= 18;
var IsModify=0;
var yyy=-2000;xxx=-2000;
var skn=tips_table.style;
document.onmousemove=get_mouse;
document.onclick=HiddenTip;
document.oncontextmenu=stop;
var licons = {
'target' : '',
'icon_e' : 'icons/0.gif',
'icon_l' : 'icons/90.gif',
'icon_2' : 'icons/91.gif',
'icon_3' : 'icons/92.gif',
'icon_18' : 'icons/93.gif',
'icon_19' : 'icons/94.gif',
'icon_26' : 'icons/95.gif',
'icon_27' : 'icons/96.gif'
};var a_safemode = true;var trees = []; function RClick(FolderID)
{
if(event.button==2)
{
var TabHead='<table width="100" border="0" cellspacing="1" cellpadding="0" align="center" bgcolor="#FFFFFF">';
var mnuAddNew='<tr><td id="mnuaddnew" bgcolor="#A0B4DA" height="20" onMouseOut="mnuaddnew.style.backgroundColor="#A0B4DA";" onMouseOver="mnuaddnew.style.backgroundColor="#000000";" width="100"><img src="/inside/images/index_image/left_dot.gif" width="20" height="16" align="absbottom"><a href="javascript:MM_goToURL("parent","add_tree.asp?id='+FolderID+'&optiontype=add")" style="text-decoration: none"><font color="#FFFFFF" style="font-size: 9pt">新建目录</font></a><font color="#FFFFFF"></font></td></tr>';
var mnuModify='<tr><td id="mnumodify" bgcolor="#A0B4DA" height="20" onMouseOut="mnumodify.style.backgroundColor="#A0B4DA";" onMouseOver="mnumodify.style.backgroundColor="#000000";" width="100"><img src="/inside/images/index_image/left_dot.gif" width="20" height="16" align="absbottom"><a href="javascript:MM_goToURL("parent","edit_tree.asp?id='+FolderID+'&optiontype=edit")" style="text-decoration: none"><font style="font-size: 9pt" color="#FFFFFF">修改目录</font></a></td></tr>';
var mnuDelete='<tr><td id="mnudelete" bgcolor="#A0B4DA" height="20" onMouseOut="mnudelete.style.backgroundColor="#A0B4DA";" onMouseOver="mnudelete.style.backgroundColor="#000000";" width="100"><img src="/inside/images/index_image/left_dot.gif" width="20" height="16" align="absbottom"><a href="javascript:DeleteCustom("'+FolderID+'")" style="text-decoration: none"><font style="font-size: 9pt" color="#FFFFFF">删除目录</font></a></td></tr>';
var mnuEnd='</table>'
skn.left =xxx;
skn.top =yyy;
if(FolderID=="")
{
tips_table.innerHTML=TabHead+mnuAddNew+mnuEnd;
}
else
{
tips_table.innerHTML=TabHead+mnuAddNew+mnuModify+mnuDelete+mnuEnd;
}
skn.visibility="visible";
}
}function DHTMLSupported () {
try {
var tmp = "";
tmp = document.body.innerHTML;
if (tmp.length <= 0) return false;
} catch(e) {
return false;
}
return true;
}