我想在图片上实现右键,左健时执行不同的函数,并屏掉在图片上右键上的系统默认菜单 oncontextmenu="mm(); return false" 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 <html><head><title>Untitled Document</title><meta http-equiv="Content-Type" content="text/html; charset=gb2312"><style>td {font-size: 13px}.menu1 {cursor: default}</style><script language=Javascript>var menuclass,menutitle;function document.onmouseover(){ menuclass = window.event.toElement.className; menutitle = window.event.toElement.innerText; //得到鼠?当前所??的文字,以便判断是否?出菜? }function document.onmousedown(){ var x = window.event.clientX; var y = window.event.clientY; var x0=document.body.clientWidth; var y0=document.body.clientHeight; if(event.button==2 && (menutitle=="?接一" || menutitle=="?接二")){ ie5menu.style.display=""; var x1=document.all.ie5menu.clientWidth; var y1=document.all.ie5menu.clientHeight; ie5menu.style.left = (x0-x-4<x1) ? x-x1-4 : x+2; ie5menu.style.top = (y0-y<y1) ? y-y1-4 : y; //??位置?置法的好?在于?到不??的?候菜?会真?window菜?一?移位 } if(event.button==1 && menuclass != "menu1") ie5menu.style.display = "none";}function jumptoie5(){ if (event.srcElement.className=="menu1"){ if (event.srcElement.getAttribute("target")!=null) window.open(event.srcElement.url,event.srcElement.getAttribute("target")) else window.location=event.srcElement.url } ie5menu.style.display = "none"; }function mo(tt,st){ //当鼠????会?到的底色与文字?色 if (tt=="over"){st.background='highlight';st.color='#FFFFFF';} else {st.background='menu'; st.color='#000000';} }</SCRIPT></head><body leftmargin=0 topmargin=0 marginwidth=0 marginheight=0 oncontextmenu="window.event.returnValue=false;//取消鼠?右?菜?" onkeydown="if(event.keyCode==27)document.all.ie5menu.style.display='none';//ESC??藏菜?"><br><br><br><br> <a href="http://www.sina.com.cn">?接一</a><br><br> <a href="http://www.163.com">?接二</a><DIV id=ie5menu style="BACKGROUND: menu; border: 2 outset #FFFFFF;z-index: 12; position: absolute; display: none" onclick="jumptoie5()"><table border=0 cellspacing=2 cellpadding=1><tr><td noWrap class=menu1 onmouseover=mo("over",this.style) onmouseout=mo("out",this.style) url="addGroup.htm" target="main"> 添加子? </td></tr><tr><td noWrap class=menu1 onmouseover=mo("over",this.style) onmouseout=mo("out",this.style) url="delGroup.jsp" target="main"> 修改??</td></tr><tr><td noWrap class=menu1 onmouseover=mo("over",this.style) onmouseout=mo("out",this.style) url="#"> ?除??</td></tr></table></div></body></html>你把判断条件稍微改改就可以用了。 jquery选择器的一个问题 请问下php集成jquery的uploadify,如何把上传图片路径保存数据库 js 打印 不想显示提示对话框 直接打印 我又来了..又是正则表达式的问题 熟悉CoolJsTree的朋友问个问题 ==============我有个车辆出厂回厂的管理需求,要求控制出厂回厂时间,要有小时,分钟输入功能,请问怎样控制才好?谢谢! 使用javascript 加载其他站点的xml数据 这样创建table怎么不行 请问如何取得text里字符的长度?? 关于数字千分位的转化,"转过去容易转回来难"啊,孟兄帮忙来看看 问个简单的问题 请问?WINDOW窗口问题
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<style>
td {font-size: 13px}
.menu1 {cursor: default}
</style>
<script language=Javascript>
var menuclass,menutitle;
function document.onmouseover(){
menuclass = window.event.toElement.className;
menutitle = window.event.toElement.innerText; //得到鼠?当前所??的文字,以便判断是否?出菜?
}
function document.onmousedown(){
var x = window.event.clientX;
var y = window.event.clientY;
var x0=document.body.clientWidth;
var y0=document.body.clientHeight; if(event.button==2 && (menutitle=="?接一" || menutitle=="?接二")){
ie5menu.style.display="";
var x1=document.all.ie5menu.clientWidth;
var y1=document.all.ie5menu.clientHeight;
ie5menu.style.left = (x0-x-4<x1) ? x-x1-4 : x+2;
ie5menu.style.top = (y0-y<y1) ? y-y1-4 : y;
//??位置?置法的好?在于?到不??的?候菜?会真?window菜?一?移位
}
if(event.button==1 && menuclass != "menu1") ie5menu.style.display = "none";
}function jumptoie5(){
if (event.srcElement.className=="menu1"){
if (event.srcElement.getAttribute("target")!=null)
window.open(event.srcElement.url,event.srcElement.getAttribute("target"))
else
window.location=event.srcElement.url
}
ie5menu.style.display = "none";
}function mo(tt,st){ //当鼠????会?到的底色与文字?色
if (tt=="over"){st.background='highlight';st.color='#FFFFFF';}
else {st.background='menu'; st.color='#000000';}
}
</SCRIPT>
</head>
<body leftmargin=0 topmargin=0 marginwidth=0 marginheight=0 oncontextmenu="window.event.returnValue=false;//取消鼠?右?菜?"
onkeydown="if(event.keyCode==27)document.all.ie5menu.style.display='none';//ESC??藏菜?">
<br><br><br><br>
<a href="http://www.sina.com.cn">?接一</a><br><br>
<a href="http://www.163.com">?接二</a><DIV id=ie5menu style="BACKGROUND: menu; border: 2 outset #FFFFFF;z-index: 12; position: absolute; display: none" onclick="jumptoie5()">
<table border=0 cellspacing=2 cellpadding=1>
<tr><td noWrap class=menu1 onmouseover=mo("over",this.style) onmouseout=mo("out",this.style) url="addGroup.htm" target="main"> 添加子? </td></tr>
<tr><td noWrap class=menu1 onmouseover=mo("over",this.style) onmouseout=mo("out",this.style) url="delGroup.jsp" target="main"> 修改??</td></tr>
<tr><td noWrap class=menu1 onmouseover=mo("over",this.style) onmouseout=mo("out",this.style) url="#"> ?除??</td></tr>
</table></div></body>
</html>你把判断条件稍微改改就可以用了。