마우스우측금지해도 관리자에서는 드래그 되게 질문

마우스우측금지해도 관리자에서는 드래그 되게 질문

QA

마우스우측금지해도 관리자에서는 드래그 되게 질문

답변 2

본문

페이지 내  tail.php 에 마우스 우측금지 스크립트를 구글에서 찾아 넣어 드래그 방지를 넣었는데요

 

관리자 모드에서만 드래그가 되게 하고싶은데 어떻게 해야 될까요..

 

 

<!--마우스우측금지-->
<script>
$(document).ready(function() {
    $(document).bind("contextmenu", function(e){
        alert("오른쪽 마우스 금지");
        return false;
    });
 
    $('img').bind("contextmenu",function(e){
        alert("그림에서 오른쪽 마우스 금지");
        return false;
    });
 
    $('img').bind("selectstart",function(e){
        alert("그림에서 오른쪽 마우스 금지");
        return false; 
    });
});
 
document.oncontextmenu=function(){return false;} // 우클릭 방지
document.onselectstart=function(){return false;} // 드래그 방지
//document.ondragstart=function(){return false;} // 선택 방지
//document.onmousedown=function(){return false;}
</script>
<!--마우스우측금지-->

이 질문에 댓글 쓰기 :

답변 2



<?php if(!$is_admin) {?>
<!--마우스우측금지-->
<script>
$(document).ready(function() {
    $(document).bind("contextmenu", function(e){
        alert("오른쪽 마우스 금지");
        return false;
    });
 
    $('img').bind("contextmenu",function(e){
        alert("그림에서 오른쪽 마우스 금지");
        return false;
    });
 
    $('img').bind("selectstart",function(e){
        alert("그림에서 오른쪽 마우스 금지");
        return false; 
    });
});
 
document.oncontextmenu=function(){return false;} // 우클릭 방지
document.onselectstart=function(){return false;} // 드래그 방지
//document.ondragstart=function(){return false;} // 선택 방지
//document.onmousedown=function(){return false;}
</script>
<!--마우스우측금지-->
<?php } ?>


<?php if(!defined('G5_IS_ADMIN')) {?>
<!--마우스우측금지-->
<script>
$(document).ready(function() {
    $(document).bind("contextmenu", function(e){
        alert("오른쪽 마우스 금지");
        return false;
    });
 
    $('img').bind("contextmenu",function(e){
        alert("그림에서 오른쪽 마우스 금지");
        return false;
    });
 
    $('img').bind("selectstart",function(e){
        alert("그림에서 오른쪽 마우스 금지");
        return false; 
    });
});
 
document.oncontextmenu=function(){return false;} // 우클릭 방지
document.onselectstart=function(){return false;} // 드래그 방지
//document.ondragstart=function(){return false;} // 선택 방지
//document.onmousedown=function(){return false;}
</script>
<!--마우스우측금지-->
<?php } ?>
답변을 작성하시기 전에 로그인 해주세요.
QA 내용 검색
질문등록
전체 59,614
© SIRSOFT
현재 페이지 제일 처음으로