이미지 팝업창에서 오픈쪽버튼 사용금지 적용했는데요

수고 많으십니다.

common.js 파일에서 이미지 클릭시 뜨는 팝업창에서 오른쪽버튼 사용금지 소스를 적용시켰는데요..
이미지가 클때 왼쪽마우스클릭후 드래그가 가능했는데, 오른쪽버튼 사용금지 소스 적용후 드래그가 안됩니다. 아시는분 설명 부탁드립니다.

--------- 적용 소스 ------
win=window.open("","image_window",settings);
win.document.open();
win.document.write ("<html><head> \n<meta http-equiv='imagetoolbar' CONTENT='no'> \n<meta http-equiv='content-type' content='text/html; charset="+g4_charset+"'>\n");
var size = "이미지 사이즈 : "+w+" x "+h;
win.document.write ("<title>"+size+"</title> \n");
if(w >= screen.width || h >= screen.height) {
win.document.write (js_url);
var click = "ondblclick='window.close();' style='cursor:move' title=' "+size+" \n\n 이미지 사이즈가 화면보다 큽니다. \n 왼쪽 버튼을 클릭한 후 마우스를 움직여서 보세요. \n\n 더블 클릭하면 닫혀요. '";
}
else
var click = "onclick='window.close();' style='cursor:pointer' title=' "+size+" \n\n 클릭하면 닫혀요. '";
win.document.write ("<style>.dragme{position:relative;}</style> \n");
win.document.write ("<body leftmargin=0 topmargin=0 bgcolor=#dddddd style='cursor:arrow;'> \n");
win.document.write ("<table width=100% height=100% cellpadding=0 cellspacing=0><tr><td align=center valign=middle><img src='"+img.src+"' width='"+w+"' height='"+h+"' border=0 class='dragme' "+click+"></td></tr></table>");
// 팝업창 오른쪽버튼 사용금지 스크립트 추가
win.document.write ("<script type='text/javascript'>\n");
win.document.write ("function checkAlt(){ \n");
win.document.write ("var keyValue = event.keyCode;\n");
win.document.write ("if( keyValue==18 ){\n");
win.document.write ("alert('ALT 키는 사용하실 수 없습니다.');\n");
win.document.write ("return false;\n");
win.document.write ("}\n");
win.document.write ("if( keyValue==17 ){\n");
win.document.write ("alert('CTRL 키는 사용하실 수 없습니다.');\n");
win.document.write ("return false;\n");
win.document.write ("}\n");
win.document.write ("}\n");
win.document.write ("function click(){\n");
win.document.write ("if((event.button==2) || (event.button==3)) {\n");
win.document.write ("alert('오른쪽 버튼은 사용하실 수 없습니다');\n");
win.document.write ("return false;\n");
win.document.write ("}\n");
win.document.write ("}\n");
win.document.write ("document.onkeydown = checkAlt;\n");
win.document.write ("document.onmousedown=click; \n");
win.document.write ("</SCRIPT>");
//팝업창 오른쪽버튼 사용금지 스크립트 끝
win.document.write ("</body></html>");
win.document.close();

if(parseInt(navigator.appVersion) >= 4){win.window.focus();}
}
|

댓글 2개

document.onmousedown=selectmouse; 가 실행 되어야 드래그가 되는 것인데
document.onmousedown=click; 해버렸으니 당연히 이미지 이동이 안되지요

저 부분 원위치 시키고 click 함수에 해당하는 부분을 selectmouse 함수 첫 부분에 넣으세요

win.document.write ("if((event.button==2) || (event.button==3)) {\n");
win.document.write ("alert('오른쪽 버튼은 사용하실 수 없습니다');\n");
win.document.write ("return false;\n");
win.document.write ("}\n");

요 부분만 넣으세요
흠... 저는 잘안되는데 소스를 좀 수정해수실 수 없으세요
댓글을 작성하시려면 로그인이 필요합니다.

그누4 질문답변

그누보드4 관련 질문은 QA 로 이전됩니다. QA 그누보드4 바로가기 기존 게시물은 열람만 가능합니다.

+
제목 글쓴이 날짜 조회
17년 전 조회 860
17년 전 조회 757
17년 전 조회 957
17년 전 조회 967
17년 전 조회 776
17년 전 조회 689
17년 전 조회 764
17년 전 조회 739
17년 전 조회 690
17년 전 조회 998
17년 전 조회 744
17년 전 조회 744
17년 전 조회 786
17년 전 조회 778
17년 전 조회 1,520
17년 전 조회 758
17년 전 조회 839
17년 전 조회 664
17년 전 조회 967
17년 전 조회 1,530