[img_gallery] 이미지 클릭시 새 창 크기 > 그누3질답

그누3질답

[img_gallery] 이미지 클릭시 새 창 크기 정보

그누보드 [img_gallery] 이미지 클릭시 새 창 크기

본문

img_gallery에서 본문 이미지를 클릭하면 새 창에서 이미지가 나오는데요,
스크린보다 이미지가 크면 찌그러지더라구요..

전 원본 사이즈로 보이되 스크롤이 생기게 하고 싶거든요.

그래서 javascript.js에서 scrollbars를 yes로 바꿨더니
스크롤이 생기긴 하는데 새창의 크기가 이미지 크기랑 같아서
스크롤이 있으나마나에요.

예를들어 이미지가 600*1500인데 해상도가 1024*768이면
이미지는 그대로 600*1500이고, 창 크기는 600*(768-10)이 되면서 스크롤이 생겼으면 좋겠는데...

어디서 뭘 고쳐야 하나요?
w나 h를 고치면 죄다 이미지가 찌그러져서 난감해요..ㅠㅠ


=====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) {
        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));
    }*/

//이미지 사이즈가 스크린보다 크면 스크롤 생성 <- 창 크기가 그대로니 무용지물ㅜㅜ
    if (w >= screen.width | h >= screen.height) {
scs = 'yes';
    }else {scs = 'no';}

    var settings  ='width='+w+',';
        settings +='height='+h+',';
        settings +='top='+wint+',';
        settings +='left='+winl+',';
        settings +='scrollbars='+scs+',';
        settings +='resizable='+scs+','; //스크롤을 못해서 임시방편으로 resizable을....ㅜㅜ
        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+"' 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();}
}

댓글 전체

전체 9,564
그누3질답 내용 검색

회원로그인

(주)에스아이알소프트 / 대표:홍석명 / (06211) 서울특별시 강남구 역삼동 707-34 한신인터밸리24 서관 1402호 / E-Mail: admin@sir.kr
사업자등록번호: 217-81-36347 / 통신판매업신고번호:2014-서울강남-02098호 / 개인정보보호책임자:김민섭(minsup@sir.kr)
© SIRSOFT