如题。。。网上找了很多,但在360浏览器下都出不来,想模仿 http://ckfinder.com/demo 里面的右键菜单
------解决方案--------------------
创建一个层,在鼠标右键的时候显示并最后return false,阻止冒泡事件
------解决方案--------------------
- HTML code
<style type="text/css"> #popmenu{position:absolute;width:100px;height:200px;background:#eee;display:none;} </style> <script type="text/javascript"> document.oncontextmenu = function (e) { e = e || window.event; var m = document.getElementById('popmenu'); m.style.left = e.clientX + 'px'; m.style.top = e.clientY + 'px'; m.style.display = 'block'; return false; } </script> <body> <div id="popmenu">自定义右键菜单内容</div>