마우스우측버튼,F3,F5,F11,F6,마우스키,쉬프트+링크클릭(새창방지),컨트롤 조합키, 백스페이스,드래그 방지
<script>
/* Lepas */
//마우스우측버튼,F3,F5,F11,F6,마우스키,쉬프트+링크클릭(새창방지),컨트롤 조합키, 백스페이스,드래그 방지//
var keydownCtrl = 0;
var keydownShift = 0;
document.onkeydown=keycheck;
document.onclick=clickcheck;
document.onkeyup=uncheckCtrlShift;
function keycheck()
{
switch(event.keyCode){ //키값에 따라
case 114:event.keyCode='';return false; break; //F3
case 116:event.keyCode='';return false; break; //F5
case 122:event.keyCode='';return false; break;//F11
case 117:event.keyCode='';return false; break;//F6
case 93:event.keyCode='';return false; break;//메뉴키
case 16:event.keyCode='';keydownShift=1;return false; break;//쉬프트키
case 17:event.keyCode='';keydownCtrl=1;return false; break;//컨트롤키
case 8:event.keyCode='';return false; break;//백스페이스
}
if(keydownCtrl) return false;
}
function clickcheck()
{
if(keydownShift) return false;
}
function uncheckCtrlShift()
{
if(event.keyCode==17) keydownCtrl=0;
if(event.keyCode==16) keydownShift=0;
}
</script>
<body onselectstart="return false" ondragstart="return false" oncontextmenu="return false;"><div class='small'>[이 게시물은 관리자님에 의해 2011-10-31 16:57:14 JavaScript에서 이동 됨]</div>
/* Lepas */
//마우스우측버튼,F3,F5,F11,F6,마우스키,쉬프트+링크클릭(새창방지),컨트롤 조합키, 백스페이스,드래그 방지//
var keydownCtrl = 0;
var keydownShift = 0;
document.onkeydown=keycheck;
document.onclick=clickcheck;
document.onkeyup=uncheckCtrlShift;
function keycheck()
{
switch(event.keyCode){ //키값에 따라
case 114:event.keyCode='';return false; break; //F3
case 116:event.keyCode='';return false; break; //F5
case 122:event.keyCode='';return false; break;//F11
case 117:event.keyCode='';return false; break;//F6
case 93:event.keyCode='';return false; break;//메뉴키
case 16:event.keyCode='';keydownShift=1;return false; break;//쉬프트키
case 17:event.keyCode='';keydownCtrl=1;return false; break;//컨트롤키
case 8:event.keyCode='';return false; break;//백스페이스
}
if(keydownCtrl) return false;
}
function clickcheck()
{
if(keydownShift) return false;
}
function uncheckCtrlShift()
{
if(event.keyCode==17) keydownCtrl=0;
if(event.keyCode==16) keydownShift=0;
}
</script>
<body onselectstart="return false" ondragstart="return false" oncontextmenu="return false;"><div class='small'>[이 게시물은 관리자님에 의해 2011-10-31 16:57:14 JavaScript에서 이동 됨]</div>
댓글 6개
20년 전
마우스우측버튼은 막을수가 없네요
19년 전
마우스 오른쪽 버튼 막기용 스크립트
function norightclick(e) // 다른 모든 브라우저에서 작동
{
if (window.Event) // 다시, IE 또는 NAV ?
{
if (e.which == 2 || e.which == 3)
return false;
} else if (event.button == 2 || event.button == 3) {
event.cancelBubble = true
event.returnValue = false;
return false;
}
}
document.onmousedown = norightclick;
function norightclick(e) // 다른 모든 브라우저에서 작동
{
if (window.Event) // 다시, IE 또는 NAV ?
{
if (e.which == 2 || e.which == 3)
return false;
} else if (event.button == 2 || event.button == 3) {
event.cancelBubble = true
event.returnValue = false;
return false;
}
}
document.onmousedown = norightclick;
7년 전
좋은 정보 알아갑니다 감사합니다!
codribble
7년 전
좋은 정보 감사합니다~
4년 전
감사합니다
3년 전
감사해요^^
게시판 목록
개발자팁
개발과 관련된 유용한 정보를 공유하세요.
질문은 QA에서 해주시기 바랍니다.
질문은 QA에서 해주시기 바랍니다.
| 번호 | 분류 | 제목 | 글쓴이 | 날짜 | 조회 |
|---|---|---|---|---|---|
| 326 | Flash |
|
20년 전 | 7808 | |
| 325 | 기타 |
|
20년 전 | 4663 | |
| 324 | 기타 |
hwatta
|
20년 전 | 3211 | |
| 323 | 기타 | 20년 전 | 9304 | ||
| 322 | MySQL | 20년 전 | 4153 | ||
| 321 | JavaScript | 20년 전 | 4821 | ||
| 320 | 기타 | 20년 전 | 6545 | ||
| 319 | 기타 | 20년 전 | 3873 | ||
| 318 | JavaScript | 20년 전 | 5252 | ||
| 317 | 기타 | 20년 전 | 4349 | ||
| 316 | Flash | 20년 전 | 5718 | ||
| 315 | JavaScript |
|
20년 전 | 7098 | |
| 314 | 기타 |
|
20년 전 | 8001 | |
| 313 | MySQL | 20년 전 | 8664 | ||
| 312 | JavaScript | 20년 전 | 3695 | ||
| 311 | 기타 |
|
20년 전 | 4679 | |
| 310 | 기타 |
|
20년 전 | 5264 | |
| 309 | JavaScript |
|
20년 전 | 4104 | |
| 308 | 기타 |
hwatta
|
20년 전 | 3790 | |
| 307 | JavaScript | 20년 전 | 6093 | ||
| 306 | 기타 | 20년 전 | 3494 | ||
| 305 | 기타 |
prosper
|
20년 전 | 3407 | |
| 304 | 기타 |
prosper
|
20년 전 | 3140 | |
| 303 | 기타 |
prosper
|
20년 전 | 3017 | |
| 302 | JavaScript | 20년 전 | 4995 | ||
| 301 | JavaScript | 20년 전 | 6276 | ||
| 300 | 기타 |
hwatta
|
20년 전 | 4076 | |
| 299 | 기타 |
|
20년 전 | 4208 | |
| 298 | Flash | 20년 전 | 7237 | ||
| 297 | 기타 |
hwatta
|
20년 전 | 4273 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기