미리보기 : http://oxtag.com/html/ex/imgResize20070824/

<script language="javascript" src="img_resize.js" type="text/javascript"></script>

<table width="620" cellspacing="0" cellpadding="0" align="center" style="table-layout: fixed; overflow: hidden; word-wrap:break-word; word-break:break-all;">
                <tr><td height="10"></td></tr>
                <tr><td>
        <img src='img/2097668193_b07e9513_img_1393658_1042_0.jpg' name='target_resize_image[]' onclick='image_window(this);' style='cursor:pointer;' title=''>
                <p>
                <img src='img/2097668193_cfd0a951_img_1393658_1042_1.gif' name='target_resize_image[]' onclick='image_window(this);' style='cursor:pointer;' title=''>
                <p><p>
        <img src='img/2097668193_b07e9513_img_1393658_1042_0.jpg' name='target_resize_image[]' onclick='image_window2(this,"1707","1100");' style='cursor:pointer;' title=''>
                <p>
                <img src='img/2097668193_cfd0a951_img_1393658_1042_1.gif' name='target_resize_image[]' onclick='image_window2(this,"397","612");' style='cursor:pointer;' title=''>

                        </td></tr>
                <tr>
                        <td align="right">
                                        </td>
                </tr>
                </table>


<script language="JavaScript">
<!--
// HTML 로 넘어온 <img ... > 태그의 폭이 테이블폭보다 크다면 테이블폭을 적용한다.
function resize_image()
{
    var target = document.getElementsByName('target_resize_image[]');
    var image_width = parseInt('630');
    var image_height = 0;

    for(i=0; i<target.length; i++) {
        // 원래 사이즈를 저장해 놓는다
        target[i].tmp_width  = target[i].width;
        target[i].tmp_height = target[i].height;
        // 이미지 폭이 테이블 폭보다 크다면 테이블폭에 맞춘다
        if(target[i].width > image_width) {
            image_height = parseFloat(target[i].width / target[i].height)
            target[i].width = image_width;
            target[i].height = parseInt(image_width / image_height);
        }
    }
}

window.onload = resize_image;

function file_download(link, file)
{
document.location!.href = link;
}
//-->
</script>

Posted by 알 수 없는 사용자
,