< script type = "text/javascript" >function prohibitMouse ( oEvent ){if ( window . event ){ //考虑浏览器之间的兼容性oEvent = window . event ;alert ( oEvent . returnValue );oEvent . returnValue = false ; //取消默认事件alert ( "禁止鼠标右键!" );} else {alert ( "禁止鼠标右键!" );oEvent . preventDefault (); //取消默认事件}}function prohibitClick (){alert ( "禁止鼠标点击!" );return false ;}document . oncontextmenu = prohibitMouse ;document . onclick = prohibitClick ;< /script>
web浏览器中禁止用户鼠标右键与鼠标点击
最新推荐文章于 2024-05-17 09:23:02 发布