<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=gb2312" /> <title>无标题文档</title> </head> <mce:style><!-- #rmenu { list-style:none; margin:0; padding:0; border:1px solid #CCCCCC; 120px; position:absolute; left:0px; top:0px; display:none; z-index:99999; background-color:#F3F3F3 } #rmenu li{ 118px; height:16px; font-size:12px; margin-left:1px; margin-right:2px; cursor:pointer; padding-top:3px; padding-left:2px; } #rmenu li:hover{ background-color:#c0c0c0; color:#FF0000; } --></mce:style><style mce_bogus="1"> #rmenu { list-style:none; margin:0; padding:0; border:1px solid #CCCCCC; 120px; position:absolute; left:0px; top:0px; display:none; z-index:99999; background-color:#F3F3F3 } #rmenu li{ 118px; height:16px; font-size:12px; margin-left:1px; margin-right:2px; cursor:pointer; padding-top:3px; padding-left:2px; } #rmenu li:hover{ background-color:#c0c0c0; color:#FF0000; }</style> <body> <ul id="rmenu"> <li onclick="gm("JY")">禁言</li> <li onclick="gm("YZ")">永久禁言</li> <li onclick="gm("FH")">封号</li> <li onclick="gm("JJ")">解禁</li> <li onclick="gm("KC")">踢下线</li> <li onclick="gm("View")">查看信息</li> <li onclick="gm("RC")">重载配置</li> <li onclick="gm("AN")">发公告</li> <li onclick="gm("JY")">关闭</li> </ul> <div id="ax" style=" background-color:#999999; 200px; height:200px; border:1px solid #000066 ; position:absolute; top:200px" > dasadadsds </div> <mce:script language="javascript"><!-- function $(id) { return document.getElementById(id); } var overmenu=false; var menuname; var hmto=false; function addrm(name,mname) { $(name).oncontextmenu=function(ev){ if(document.all) ev=event; return drm(ev); } menuname=mname; $(mname).onmouseover=function(){overmenu=true;} $(mname).onmouseout =function(){overmenu=false;hide();} } function drm(ev) { if(document.all){ var x=ev.x; var y=ev.y; }else{ if(ev.button!=2) return; var x=ev.clientX; var y=ev.clientY; } $(menuname).style.left=x+5+"px"; $(menuname).style.top=y+5+"px"; $(menuname).style.display="block"; hmto=setTimeout("hide();",2000); return false; } function hide() { if(hmto) window.clearTimeout(hmto); if(arguments.length==0){ hmto=setTimeout("hide(1);",500); }else if(arguments.length==1){ hmto=setTimeout("hide(1,2);",500); }else if(arguments.length==2){ if(!overmenu) { $(menuname).style.display="none"; }else{ hmto=setTimeout("hide(1);",300); } } } //addrm(右键点的id,菜单id) addrm("ax","rmenu"); // --></mce:script> </body> </html>