oncontextmenu事件阻止系统的右键菜单,显示自己的菜单。不过新窗口还是标签页打开要看用户浏览器的配置,这个控制不了新窗口打开用window.open,指定width和height就行,但是如果用户配置了都在标签页中打开就没办法了<a href="http://bbs.csdn.net">csdn,系统菜单</a><br/>
<a href="http://bbs.csdn.net" oncontextmenu="return popMenu()">csdn,自定义菜单</a>
<div id="m" style="position:absolute;left:0px;top:50px;display:none">
<a href="#" onclick="window.open('http://bbs.csdn.net','_blank','width=800,height=500');return false;">新窗口打开</a><br/>
<a href="http://bbs.csdn.net" target="_blank">标签页打开</a>
</div>
<script>
function popMenu(e){
document.getElementById('m').style.display='block';return false;
}
</script>