백

자동이미지크기조절

<script language='javascript'>
function a(name){
w = eval("document."+name+".width");
h = eval("document."+name+".height");

maxWidth = 300; // 출력 최대이미지 가로. 이곳의 숫자를 고치세요.
maxHeight = 300; // 출력 최대 이미지 세로 . 이곳의 숫자를 고치세요.

if(w > maxWidth || h > maxHeight){
if(w > h){
nw = maxWidth;
nh = Math.round((h*nw)/w);
}else{
nh = maxHeight;
nw = Math.round((nh*w)/h);
}
}else{
nw = w;
nh = h;
}

eval("document."+name+".height="+nh);
eval("document."+name+".width="+nw);
}
</script>

<img src='http://www.happycgi.com/Attach/screen_shot/2004/08/13/b-1092371586-happycgi.jpg' name='aaaa' id='aaaa' onload='a("aaaa")'>

댓글 1개

&nbsp;&nbsp;
2004-10-16 (토) 13:17:23
특이한 스크립트군요.........^^
댓글을 작성하시려면 로그인이 필요합니다.
+
제목 글쓴이 날짜 조회
04-10-24 조회 3,216
04-10-22 조회 3,164
04-10-22 조회 2,969
04-10-20 조회 5,783
04-10-19 조회 3,026
04-10-18 조회 3,261
04-10-17 조회 4,373
04-10-15 조회 3,587
04-10-15 조회 2,894
04-10-15 조회 3,872
04-10-15 조회 3,783
04-10-15 조회 4,552
04-10-14 조회 2,903
04-10-13 조회 3,160
04-10-13 조회 3,901
04-10-12 조회 3,345
04-10-12 조회 3,384
04-10-12 조회 3,049
04-10-12 조회 3,482
04-10-09 조회 4,202