Bài viết mới
  • Tin Tức - Thủ Thuật - Download - Lập Trình

    Tuesday, September 20, 2016

    Chống click chuột Phải và Ctrl+U trong Blogger

    Posted by   on Pinterest

    Bạn ghét người khác copy bài viết của bạn? Bạn không muốn công sức và tâm huyết mình bỏ ra bị người khác lấy mất? Thủ thuật chống click chuột Phải và Ctrl+U dưới đây sẽ phần nào giúp bạn gỡ rối.

    Cách làm

    Đăng nhập Blogger ~> Mẫu ~> Chỉnh sửa HTML
    (Tùy mục đích mà bạn có thể chèn code của 1 hoặc cả 2 thủ thuật)
    1. Chống click chuột Phải
    Thêm đoạn code này trước thẻ </head> 
    <style type='text/css'>
    body{
    -webkit-touch-callout: none;
    -webkit-user-select: none; 
    -moz-user-select: none; 
    -ms-user-select: none; 
    -o-user-select: none;
    user-select: none;
    }
    </style>
     <script type='text/javascript'>
    //<![CDATA[
    // JavaScript Document
    var message="NoRightClicking"; function defeatIE() {if (document.all) {(message);return false;}} function defeatNS(e) {if (document.layers||(document.getElementById&&!document.all)) { if (e.which==2||e.which==3) {(message);return false;}}} if (document.layers) {document.captureEvents(Event.MOUSEDOWN);document.onmousedown=defeatNS;} else{document.onmouseup=defeatNS;document.oncontextmenu=defeatIE;} document.oncontextmenu=new Function("return false")
    //]]>
    </script>

    2. Chống Ctrl+U
    Thêm đoạn code này trước thẻ </head> 
    <script src='http://ajax.googleapis.com/ajax/libs/jquery/1.5/jquery.min.js'/> 
    <script type='text/javascript'>
    checkCtrl=false $(&#39;*&#39;).keydown(function(e){ 
    if(e.keyCode==&#39;17&#39;){ checkCtrl=false  } }).keyup(function(ev){ 
    if(ev.keyCode==&#39;17&#39;){ checkCtrl=false } }).keydown(function(event){ 
    if(checkCtrl){ 
    if(event.keyCode==&#39;85&#39;){ return false; } } })
    </script>

    Tiếp theo, thay thẻ 
    <body>
    Thành 
    <body onkeydown="return false">

    Lưu Mẫu lại và xem thành quả.

    No comments:
    Write comments

    Chia Sẻ Thủ Thuật Máy Tính - Học Làm IT
    Đăng Ký Nhận Tin