自己的菜单,阻止默认事件

	var oDiv=document.getElementById('div1');
	document.oncontextmenu=function(ev)
	{
		var ev=ev||event
		oDiv.style.display='block';
		oDiv.style.left=ev.clientX+'px';
		oDiv.style.top=ev.clientY+'px';
		
		return false;
		
	}
	document.onclick=function()
	{
		oDiv.style.display='none';
	}
	 

  

posted on 2016-04-22 10:29  hduhdc  阅读(163)  评论(0编辑  收藏  举报