Contents

조회 수 7454 댓글 0
?

단축키

Prev이전 문서

Next다음 문서

크게 작게 위로 아래로 댓글로 가기 인쇄
?

단축키

Prev이전 문서

Next다음 문서

크게 작게 위로 아래로 댓글로 가기 인쇄

IMG 태그 안에 삽입하여 해당 이미지 사이즈를 동적으로 조정

<html>
<head>
<title>image resize</title>
<style>
body,table,tr,td {font-size:9pt;}
</style>

<script>
function img_resize(img){
    var mywidth = 200;

    if( img.width > mywidth ){
        r = mywidth / img.width;
        w = img.width * r;
        h = img.height * r;

        img.width = w;
        img.height = h;
    }
}
</script>
</head>

<body>

<table border=0 cellpadding=0 cellspacing=0>
<tr>
        <td><img src="test.jpg" border=0 onLoad="img_resize(this);"></td>
</tr>
</table>

</body>
</html>


?