문

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

· 2004-10-26 (화) 06:27:48 · 522
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질답

9,564건
+
제목 글쓴이 날짜 조회
04-10-26 조회 429
04-10-26 조회 823
04-10-26 조회 523
04-10-26 조회 448
04-10-25 조회 553
04-10-25 조회 670
04-10-25 조회 590
04-10-25 조회 484
04-10-25 조회 734
04-10-25 조회 586
04-10-25 조회 574
04-10-25 조회 560
04-10-25 조회 399
04-10-25 조회 413
04-10-25 조회 495
04-10-24 조회 570
04-10-24 조회 379
김김진
04-10-24 조회 568
04-10-24 조회 711
04-10-23 조회 625