이미지 새창관련 질문입니다 -ㄴ-ㆀ 정보
이미지 새창관련 질문입니다 -ㄴ-ㆀ- PotatoChips 자기소개 아이디로 검색 회원게시물
- 1,877
본문
이미지 클릭시 새창뜨는걸 현재 그누보드의 방식이 아닌.. 그냥 이미지만 새창으로 뜨게할순 없을까요?;;
참고링크 > 네이버 지식인 이미지 클릭해보세요;;
http://kin.naver.com/qna/detail.nhn?d1id=3&dirId=31402&docId=133520434&qb=7J2066+47KeA&enc=utf8§ion=kin&rank=6&search_sort=0&spq=1
bbs/view.php 와 js/common.js 파일의 다음부분을 좀 변경해야 하는건가요?
만일 요부분을 변경해야 한다면 어떻게 해야 가능한지 도움좀 부탁드립니다..;;
bbs/view.php 136라인 부분
$view[content] = preg_replace("/(\<img )([^\>]*)(\>)/i", "\\1 name='target_resize_image[]' onclick='image_window(this)' style='cursor:pointer;' \\2 \\3", $view[content]);
js/common.js 에 191라인 부분
// 이미지의 크기에 따라 새창의 크기가 변경됩니다.
// zzzz님께서 알려주셨습니다. 2005/04/12
function image_window(img)
{
var w = img.tmp_width;
var h = img.tmp_height;
var winl = (screen.width-w)/2;
var wint = (screen.height-h)/3;
if (w >= screen.width) {
winl = 0;
h = (parseInt)(w * (h / w));
}
if (h >= screen.height) {
wint = 0;
w = (parseInt)(h * (w / h));
}
var js_url = "<script type='text/javascript'> \n";
js_url += "<!-- \n";
js_url += "var ie=document.all; \n";
js_url += "var nn6=document.getElementById&&!document.all; \n";
js_url += "var isdrag=false; \n";
js_url += "var x,y; \n";
js_url += "var dobj; \n";
js_url += "function movemouse(e) \n";
js_url += "{ \n";
js_url += " if (isdrag) \n";
js_url += " { \n";
js_url += " dobj.style.left = nn6 ? tx + e.clientX - x : tx + event.clientX - x; \n";
js_url += " dobj.style.top = nn6 ? ty + e.clientY - y : ty + event.clientY - y; \n";
js_url += " return false; \n";
js_url += " } \n";
js_url += "} \n";
js_url += "function selectmouse(e) \n";
js_url += "{ \n";
js_url += " var fobj = nn6 ? e.target : event.srcElement; \n";
js_url += " var topelement = nn6 ? 'HTML' : 'BODY'; \n";
js_url += " while (fobj.tagName != topelement && fobj.className != 'dragme') \n";
js_url += " { \n";
js_url += " fobj = nn6 ? fobj.parentNode : fobj.parentElement; \n";
js_url += " } \n";
js_url += " if (fobj.className=='dragme') \n";
js_url += " { \n";
js_url += " isdrag = true; \n";
js_url += " dobj = fobj; \n";
js_url += " tx = parseInt(dobj.style.left+0); \n";
js_url += " ty = parseInt(dobj.style.top+0); \n";
js_url += " x = nn6 ? e.clientX : event.clientX; \n";
js_url += " y = nn6 ? e.clientY : event.clientY; \n";
js_url += " document.onmousemove=movemouse; \n";
js_url += " return false; \n";
js_url += " } \n";
js_url += "} \n";
js_url += "document.onmousedown=selectmouse; \n";
js_url += "document.onmouseup=new Function('isdrag=false'); \n";
js_url += "//--> \n";
js_url += "</"+"script> \n";
var settings;
if (g4_is_gecko) {
settings ='width='+(w+10)+',';
settings +='height='+(h+10)+',';
} else {
settings ='width='+w+',';
settings +='height='+h+',';
}
settings +='top='+wint+',';
settings +='left='+winl+',';
settings +='scrollbars=no,';
settings +='resizable=yes,';
settings +='status=no';
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 ("</head> \n\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 ("</body></html>");
win.document.close();
if(parseInt(navigator.appVersion) >= 4){win.window.focus();}
}
참고링크 > 네이버 지식인 이미지 클릭해보세요;;
http://kin.naver.com/qna/detail.nhn?d1id=3&dirId=31402&docId=133520434&qb=7J2066+47KeA&enc=utf8§ion=kin&rank=6&search_sort=0&spq=1
bbs/view.php 와 js/common.js 파일의 다음부분을 좀 변경해야 하는건가요?
만일 요부분을 변경해야 한다면 어떻게 해야 가능한지 도움좀 부탁드립니다..;;
bbs/view.php 136라인 부분
$view[content] = preg_replace("/(\<img )([^\>]*)(\>)/i", "\\1 name='target_resize_image[]' onclick='image_window(this)' style='cursor:pointer;' \\2 \\3", $view[content]);
js/common.js 에 191라인 부분
// 이미지의 크기에 따라 새창의 크기가 변경됩니다.
// zzzz님께서 알려주셨습니다. 2005/04/12
function image_window(img)
{
var w = img.tmp_width;
var h = img.tmp_height;
var winl = (screen.width-w)/2;
var wint = (screen.height-h)/3;
if (w >= screen.width) {
winl = 0;
h = (parseInt)(w * (h / w));
}
if (h >= screen.height) {
wint = 0;
w = (parseInt)(h * (w / h));
}
var js_url = "<script type='text/javascript'> \n";
js_url += "<!-- \n";
js_url += "var ie=document.all; \n";
js_url += "var nn6=document.getElementById&&!document.all; \n";
js_url += "var isdrag=false; \n";
js_url += "var x,y; \n";
js_url += "var dobj; \n";
js_url += "function movemouse(e) \n";
js_url += "{ \n";
js_url += " if (isdrag) \n";
js_url += " { \n";
js_url += " dobj.style.left = nn6 ? tx + e.clientX - x : tx + event.clientX - x; \n";
js_url += " dobj.style.top = nn6 ? ty + e.clientY - y : ty + event.clientY - y; \n";
js_url += " return false; \n";
js_url += " } \n";
js_url += "} \n";
js_url += "function selectmouse(e) \n";
js_url += "{ \n";
js_url += " var fobj = nn6 ? e.target : event.srcElement; \n";
js_url += " var topelement = nn6 ? 'HTML' : 'BODY'; \n";
js_url += " while (fobj.tagName != topelement && fobj.className != 'dragme') \n";
js_url += " { \n";
js_url += " fobj = nn6 ? fobj.parentNode : fobj.parentElement; \n";
js_url += " } \n";
js_url += " if (fobj.className=='dragme') \n";
js_url += " { \n";
js_url += " isdrag = true; \n";
js_url += " dobj = fobj; \n";
js_url += " tx = parseInt(dobj.style.left+0); \n";
js_url += " ty = parseInt(dobj.style.top+0); \n";
js_url += " x = nn6 ? e.clientX : event.clientX; \n";
js_url += " y = nn6 ? e.clientY : event.clientY; \n";
js_url += " document.onmousemove=movemouse; \n";
js_url += " return false; \n";
js_url += " } \n";
js_url += "} \n";
js_url += "document.onmousedown=selectmouse; \n";
js_url += "document.onmouseup=new Function('isdrag=false'); \n";
js_url += "//--> \n";
js_url += "</"+"script> \n";
var settings;
if (g4_is_gecko) {
settings ='width='+(w+10)+',';
settings +='height='+(h+10)+',';
} else {
settings ='width='+w+',';
settings +='height='+h+',';
}
settings +='top='+wint+',';
settings +='left='+winl+',';
settings +='scrollbars=no,';
settings +='resizable=yes,';
settings +='status=no';
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 ("</head> \n\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 ("</body></html>");
win.document.close();
if(parseInt(navigator.appVersion) >= 4){win.window.focus();}
}
댓글 전체
지금 현제 그렇게 되어 있는데요??
구체적으로 님께서 개발하시는 홈페이지를 알려주시고.. 질문 하셨으면.......
구체적으로 님께서 개발하시는 홈페이지를 알려주시고.. 질문 하셨으면.......