Còn đây là đoạn code dùng để chống click chuột phài : - Bạn có thể thay dòng chữ màu đỏ </script> <script language='javascript'> var msg="không được click chuột phải"; function disableIE() {if (document.all) {alert(msg);return false;} } function disableNS(e) { if (document.layers (document.getElementById&&!document.all)) { if (e.which==2 e.which==3) {alert(msg);return false;} } } if (document.layers) { document.captureEvents(Event.MOUSEDOWN);document.onmousedown=disableNS; } else { document.onmouseup=disableNS;document.oncontextmenu=disableIE; } document.oncontextmenu=new Function("alert(msg);return false") </script> |
Nhãn: Thủ Thuật Cho Blog
0 nhận xét:
Đăng nhận xét