页面上有个 <asp:panel .....>
当我点节点的右键时显示该Panel,并且它的位置就象右键菜单那样可以变化。
------解决方案--------------------------------------------------------
javascript
oncontextmenu = "计算坐标,并显示层 "
------解决方案--------------------------------------------------------
另外你应该先说一下 你的dotnet版本
http://blog.csdn.net/lxp916/archive/2006/02/10/596046.aspx
http://hi.baidu.com/wqeast/blog/item/c085db2a5907cc9b033bf6b9
------解决方案--------------------------------------------------------
<asp:TreeView ID= "TreeView1 " runat= "server " />
添加節點的時指定節點的值為
treeNode.Text = " <div onclick= 'ShowRightMenu(\ " " + node.Name + "\ ",this) '> " + node.Name + " </div> ";
js顯示右鍵菜單
function ShowMenu(sender,object)
{
var popMenu = document.getElementById( "PopMenu ");//Panel生成的div
popMenu.style.display = "block ";
popMenu.style.left = document.body.scrollLeft+event.x;
popMenu.style.top = document.body.scrollTop+event.y;
}