새창 원본이미지 문제 해결못해서 이렇게 요청합니다.. 정보
새창 원본이미지 문제 해결못해서 이렇게 요청합니다..
본문
내용에서 이미지를 클릭해서 원본이미지를 보면 해상도보다 큰 이미지일경우
세로가 짜부되는 현상이 있네요....
자바에보니까... 소스가 있던데요...
// 3.36
function image_window(img, w, h)
{
var tmp_w = w;
var tmp_h = h;
winl = (screen.width-w)/2;
wint = (screen.height-h)/3;
if (w >= screen.width) {
winl = 0;
w = screen.width - 10;
h = (parseInt)(w * (h / w));
}
if (h >= screen.height) {
wint = 0;
h = screen.height - 80;
w = (parseInt)(h * (w / h));
}
var settings ='width='+w+',';
settings +='height='+h+',';
settings +='top='+wint+',';
settings +='left='+winl+',';
settings +='scrollbars=no,';
settings +='resizable=no,';
settings +='status=no';
win=window.open("","newWindow",settings);
win.document.open();
win.document.write ("<html><head><meta http-equiv='content-type' content='text/html; charset=euc-kr'>");
win.document.write ("<title>이미지 보기</title></head>");
win.document.write ("<body leftmargin=0 topmargin=0>");
//win.document.write ("<img src='"+img+"' width='"+w+"' height='"+h+" 'border=0 onclick='window.close();' style='cursor:hand' title='해상도 ("+tmp_w+"x"+tmp_h+")\n클릭하면 닫혀요'>");
win.document.write ("<img src='"+img+"' width='"+w+"' border=0 onclick='window.close();' style='cursor:hand'>");
win.document.write ("</body></html>");
win.document.close();
if(parseInt(navigator.appVersion) >= 4){win.window.focus();}
}
세로이미지가... 짜부되는현상을 막기위해 height='"+h+" 를 지우고 했느데요.... 만약 해상도보다..
길거나 넓은 이미지가 나오면 자동으로 스크류가 생기는 방법 아시는분 있으면 .... 소스공개좀 해주세요...^^*
그럼 항상 행운이따르시고 행복이 가득한 나날을 보내세요..^^*
세로가 짜부되는 현상이 있네요....
자바에보니까... 소스가 있던데요...
// 3.36
function image_window(img, w, h)
{
var tmp_w = w;
var tmp_h = h;
winl = (screen.width-w)/2;
wint = (screen.height-h)/3;
if (w >= screen.width) {
winl = 0;
w = screen.width - 10;
h = (parseInt)(w * (h / w));
}
if (h >= screen.height) {
wint = 0;
h = screen.height - 80;
w = (parseInt)(h * (w / h));
}
var settings ='width='+w+',';
settings +='height='+h+',';
settings +='top='+wint+',';
settings +='left='+winl+',';
settings +='scrollbars=no,';
settings +='resizable=no,';
settings +='status=no';
win=window.open("","newWindow",settings);
win.document.open();
win.document.write ("<html><head><meta http-equiv='content-type' content='text/html; charset=euc-kr'>");
win.document.write ("<title>이미지 보기</title></head>");
win.document.write ("<body leftmargin=0 topmargin=0>");
//win.document.write ("<img src='"+img+"' width='"+w+"' height='"+h+" 'border=0 onclick='window.close();' style='cursor:hand' title='해상도 ("+tmp_w+"x"+tmp_h+")\n클릭하면 닫혀요'>");
win.document.write ("<img src='"+img+"' width='"+w+"' border=0 onclick='window.close();' style='cursor:hand'>");
win.document.write ("</body></html>");
win.document.close();
if(parseInt(navigator.appVersion) >= 4){win.window.focus();}
}
세로이미지가... 짜부되는현상을 막기위해 height='"+h+" 를 지우고 했느데요.... 만약 해상도보다..
길거나 넓은 이미지가 나오면 자동으로 스크류가 생기는 방법 아시는분 있으면 .... 소스공개좀 해주세요...^^*
그럼 항상 행운이따르시고 행복이 가득한 나날을 보내세요..^^*
댓글 전체
위 소스중에서 이렇게 변경하면 되지 않을까요?
var settings ='width='+w+',';
settings +='height='+h+',';
settings +='top='+wint+',';
settings +='left='+winl+',';
if ((h >= screen.height) || (w >= screen.height)) {
settings +='scrollbars=yes,';
}
else {
settings +='scrollbars=no,';
}
settings +='resizable=no,';
settings +='status=no';
var settings ='width='+w+',';
settings +='height='+h+',';
settings +='top='+wint+',';
settings +='left='+winl+',';
if ((h >= screen.height) || (w >= screen.height)) {
settings +='scrollbars=yes,';
}
else {
settings +='scrollbars=no,';
}
settings +='resizable=no,';
settings +='status=no';
고맙습니다....
이렇게 하니까 되더군요...
if (h >= screen.height) {
wint = 0;
//h = screen.height - 80;
w = (parseInt)(h * (w / h));
}
알려주신 방법으로 일단 올리고....
그 위에 주석처리해서 사용을 안하니까 정상적으로 작동하네요..
저처럼 해결못하신분을 위해 올립니다..
이렇게 하니까 되더군요...
if (h >= screen.height) {
wint = 0;
//h = screen.height - 80;
w = (parseInt)(h * (w / h));
}
알려주신 방법으로 일단 올리고....
그 위에 주석처리해서 사용을 안하니까 정상적으로 작동하네요..
저처럼 해결못하신분을 위해 올립니다..