防止选择,兼容ff和ie

防止用户选择页面的内容,阻止系统右键弹出菜单
+展开
-HTML
<script>
document.oncontextmenu=function(){return false;}
document.onselectstart=function(){return false;}//这个函数是对ie

</script> 
<style>   
  html,body{   
                      height:100%;   
                      width:100%;   
                      padding:0px;   
                      margin:0px;                       
            }
   
      /*下面这个css是firefox防止选择的,firefox没有onselectstart事件*/
            body   
            {   
                    -moz-user-focus:   ignore;   
                    -moz-user-input:   disabled;   
                    -moz-user-select:   none;   
            }
     
    
  
</style>    
    
  ddfdfdfdffd

加支付宝好友偷能量挖...


原创文章,转载请注明出处:防止选择,兼容ff和ie

评论(0)Web开发网
阅读(137)喜欢(0)HTML/CSS兼容/XML