해결했어요~^^ - [img_gallery] 이미지 클릭시 새 창 크기 정보
그누보드 해결했어요~^^ - [img_gallery] 이미지 클릭시 새 창 크기본문
settings에 있는 width랑 height가 창 크기군요~^^;
그래서 새로운 변수 sw와 sh를 만들어서 따로 조정해줬어요.^^
=====javascript.js=================
// 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 | h >= screen.height) {
scs = 'yes';
}else {scs = 'no';}
// 가로, 세로 창 크기 변수
var sw = w;
var sh = h;
//이미지 가로가 스크린보다 크면 가로창크기 수정
if (w >= screen.width) {
sw = screen.width-10;
sh = sh+16;
winl = 0;
}
//이미지 세로가 스크린보다 크면 세로창크기 수정
if (h >= screen.height) {
sh = screen.height-80;
sw = sw+16;
wint = 0;
}
var settings ='width='+sw+',';
settings +='height='+sh+',';
settings +='top='+wint+',';
settings +='left='+winl+',';
settings +='scrollbars='+scs+',';
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'>");
win.document.write ("</body></html>");
win.document.close();
if(parseInt(navigator.appVersion) >= 4){win.window.focus();}
}
그래서 새로운 변수 sw와 sh를 만들어서 따로 조정해줬어요.^^
=====javascript.js=================
// 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 | h >= screen.height) {
scs = 'yes';
}else {scs = 'no';}
// 가로, 세로 창 크기 변수
var sw = w;
var sh = h;
//이미지 가로가 스크린보다 크면 가로창크기 수정
if (w >= screen.width) {
sw = screen.width-10;
sh = sh+16;
winl = 0;
}
//이미지 세로가 스크린보다 크면 세로창크기 수정
if (h >= screen.height) {
sh = screen.height-80;
sw = sw+16;
wint = 0;
}
var settings ='width='+sw+',';
settings +='height='+sh+',';
settings +='top='+wint+',';
settings +='left='+winl+',';
settings +='scrollbars='+scs+',';
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'>");
win.document.write ("</body></html>");
win.document.close();
if(parseInt(navigator.appVersion) >= 4){win.window.focus();}
}
댓글 전체