해결했어요~^^ - [img_gallery] 이미지 클릭시 새 창 크기

· 21년 전 · 462
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();}
}
|
댓글을 작성하시려면 로그인이 필요합니다.

그누3질답

+
제목 글쓴이 날짜 조회
21년 전 조회 468
21년 전 조회 476
21년 전 조회 733
21년 전 조회 433
21년 전 조회 395
21년 전 조회 431
21년 전 조회 482
21년 전 조회 473
21년 전 조회 377
21년 전 조회 463
21년 전 조회 403
21년 전 조회 495
21년 전 조회 617
21년 전 조회 533
21년 전 조회 438
21년 전 조회 687
21년 전 조회 533
21년 전 조회 521
21년 전 조회 517
21년 전 조회 346