마우스우측버튼,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년 전
감사합니다
2년 전
감사해요^^
게시판 목록
개발자팁
개발과 관련된 유용한 정보를 공유하세요.
질문은 QA에서 해주시기 바랍니다.
질문은 QA에서 해주시기 바랍니다.
| 번호 | 분류 | 제목 | 글쓴이 | 날짜 | 조회 |
|---|---|---|---|---|---|
| 86 | 기타 | 20년 전 | 3935 | ||
| 85 | JavaScript | 20년 전 | 3329 | ||
| 84 | 기타 | 20년 전 | 4406 | ||
| 83 | 기타 | 20년 전 | 5612 | ||
| 82 | 기타 | 20년 전 | 3139 | ||
| 81 | JavaScript | 20년 전 | 3795 | ||
| 80 | JavaScript | 20년 전 | 5330 | ||
| 79 | MySQL | 20년 전 | 4466 | ||
| 78 | MySQL | 20년 전 | 5099 | ||
| 77 | MySQL | 20년 전 | 4688 | ||
| 76 | MySQL | 20년 전 | 7149 | ||
| 75 | MySQL | 20년 전 | 4803 | ||
| 74 | MySQL | 20년 전 | 11634 | ||
| 73 | MySQL | 20년 전 | 4267 | ||
| 72 | MySQL | 20년 전 | 4786 | ||
| 71 | MySQL | 20년 전 | 16071 | ||
| 70 | MySQL | 20년 전 | 6150 | ||
| 69 | MySQL | 20년 전 | 5323 | ||
| 68 | MySQL | 20년 전 | 7937 | ||
| 67 | JavaScript | 20년 전 | 5027 | ||
| 66 | MySQL | 20년 전 | 8907 | ||
| 65 | MySQL | 20년 전 | 7732 | ||
| 64 | MySQL | 20년 전 | 8217 | ||
| 63 | MySQL | 20년 전 | 5867 | ||
| 62 | MySQL | 20년 전 | 8323 | ||
| 61 | JavaScript | 20년 전 | 4399 | ||
| 60 | 기타 | 20년 전 | 4335 | ||
| 59 | 기타 | 20년 전 | 3578 | ||
| 58 | 기타 | 20년 전 | 4251 | ||
| 57 | 기타 | 20년 전 | 4142 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기