急!!在线等javascript右键弹出功能菜单问题!

来源:百度知道 编辑:UC知道 时间:2024/05/16 14:03:14
题目如下:
THREE. JavaScript
1.Please use javascript to create a class of right-Click-Menu that base on the web.
2.make this class extend to a new class that can expand a second menu.
3.make this class extend to a new class that can expand a limitless menu.
explanation:for example, like the windows, when we click the right button of the mouse on the desk, that will pop-up a menu, that is what we call the right-click-menu. watch carefully, our right-click-menu is base on the web but not the others, also not like the fixed navigation.

知道的大哥大姐们,麻烦帮忙解决下。或给点些解决思路也行.能完成的,追加100分
这个题。不怎么符合要求,比如在window桌面空白处,点了右键-->新建,会显示出一堆 子选项,要的是这样的效果.

你是要window下的右键菜单吗?
是用JAVA做?
区分不同的鼠标按钮,可将getModifiers的返回值同BUTTON1_MASK,BUTTON2_MASK和BUTTON3_MASK的值进行对比。windows操作系统中,BUTTON3_MASK为右键。
if((evt.getModifiers()&InputEvent.BUTTON3_MASK)!=0)
//用于右键单击代码。
详细代码网上游有啊,还以为你是在网页中实现右键菜单呢
这是个经典的右键菜单

<script language='javascript'>
/*******以下内容可以修改***************/
var mname=new Array(
"首 页",
"修 改",
"下 载",
"删 除",
"新 建",
"刷 新"
);
//mname是菜单对应的名称,数组的个数必须与下面murl对应

var murl=new Array(
"window.open('http://www.cn5.cn','_blank','');",
"alert('修改');",
"alert('download');",
"alert('delete');",
"alert('new');",
"alert('refresh');"
)