회원 레벨이 3이상이면 그림위에서 마우스를 풀어주려고 하는데 안되네요 ㅠ..ㅠ 정보
회원 레벨이 3이상이면 그림위에서 마우스를 풀어주려고 하는데 안되네요 ㅠ..ㅠ본문
지금은 회원의 레벨에 상관없이 그림위에서 마우스를 금지하고 있는데
레벨 2 이상이면 풀어주고 싶어요. 그래서 php를 위에 넣었는데 안되네요. ㅠ..ㅠ
이런경우 어떻게 해야 할까요?
<? if ($member[mb_level] > 2) {} else { ?>
<script language="JavaScript1.2">
<!-- http://blueb.co.kr/bbs.php?table=JS_15&query=view&uid=10
var clickmessage="그림에는 오른쪽마우스버튼을 사용할 수 없습니다."
function disableclick(e) {
if (document.all) {
if (event.button==2||event.button==3) {
if (event.srcElement.tagName=="IMG"){
alert(clickmessage);
return false;
}
}
}
else if (document.layers) {
if (e.which == 3) {
alert(clickmessage);
return false;
}
}
else if (document.getElementById){
if (e.which==3&&e.target.tagName=="IMG"){
alert(clickmessage)
return false
}
}
}
if (document.all) {
if (event.button==2||event.button==3) {
if (event.srcElement.tagName=="IMG"){
alert(clickmessage);
return false;
}
}
}
else if (document.layers) {
if (e.which == 3) {
alert(clickmessage);
return false;
}
}
else if (document.getElementById){
if (e.which==3&&e.target.tagName=="IMG"){
alert(clickmessage)
return false
}
}
}
function associateimages(){
for(i=0;i<document.images.length;i++)
document.images[i].onmousedown=disableclick;
}
for(i=0;i<document.images.length;i++)
document.images[i].onmousedown=disableclick;
}
if (document.all)
document.onmousedown=disableclick
else if (document.getElementById)
document.onmouseup=disableclick
else if (document.layers)
associateimages()
// -->
</script>
document.onmousedown=disableclick
else if (document.getElementById)
document.onmouseup=disableclick
else if (document.layers)
associateimages()
// -->
</script>
<? } ?>
댓글 전체
정확히 2이상인가요, 3이상인가요?
정확히는 레벨 3 이상 입니다.
별로 잘못된 부분을 못찾겠네여;;
혹시나
주석 처리부분이 제대로 안되있어서 그럴지도 모르니
밑에서 세번째 라인
//-->
이 부분에서 //를 지워보세요
-->
이렇게요
혹시나
주석 처리부분이 제대로 안되있어서 그럴지도 모르니
밑에서 세번째 라인
//-->
이 부분에서 //를 지워보세요
-->
이렇게요
지웠는데... 결과는 레벨2에서도 마우스가 풀리네요. ㅠ..ㅠ
현재 페이지에서 회원레벨이 불러와 지나요?
<? echo $member[mb_level]; ?>
로 회원레벨이 정상적으로 불러와 지는지 한번 체크해보실래요?
<? echo $member[mb_level]; ?>
로 회원레벨이 정상적으로 불러와 지는지 한번 체크해보실래요?
흙~ 제 코드가 잘 동작하고 있었네요. ㅠ..ㅠ
문제는 사이트에 자동 레벨업 코드가 숨어 있어서 test 아이디가 자동레벨업이 되어 있었어요. ㅠ..ㅠ
아~ 테스트는 힘들어요. ㅋㅋ
문제는 사이트에 자동 레벨업 코드가 숨어 있어서 test 아이디가 자동레벨업이 되어 있었어요. ㅠ..ㅠ
아~ 테스트는 힘들어요. ㅋㅋ
ㅋ 해결되셨다니 다행이네요~ ^ㅡ^ 좋은 사이트 만드세요~ ㅎㅎ