사이트 내 전체검색
PHP
큰 이미지를 화면크기에 맞게 자동으로 사이즈 조절
최고관리자
https://cmd.kr/php/23 URL이 복사되었습니다.

본문

<HEAD>

<SCRIPT LANGUAGE="JavaScript">
<!-- Begin

function showpic(src, w, h, alt, aln, pw, ph, bw, bh) {
if (src == null) return;
var iw, ih; // Set inner width and height
if (window.innerWidth == null) {
iw = document.body.clientWidth;
ih=document.body.clientHeight;
} else {
iw = window.innerWidth;
ih = window.innerHeight;
}
if (w == null) w = iw;
if(h == null) h = ih;
if(alt == null) alt = "Picture";
if(aln == null) aln = "left";
if(pw == null) pw = 100;
if(ph == null) ph = 100;
if(bw == null) bw = 24;
if(bh == null) bh = 24;
var sw = Math.round((iw - bw) * pw / 100);
var sh = Math.round((ih - bh) * ph / 100);
if ((w * sh) / (h * sw) < 1) sw = Math.round(w * sh / h);
else sh = Math.round(h * sw / w);
document.write('<img src="'+src+'" alt="'+alt+'" width="'+sw+'" height="'+sh+'" align="'+aln+'">');
}

// End -->
</script>

</HEAD>


<BODY onresize="window.location.href = window.location.href;">

<SCRIPT LANGUAGE="JavaScript">
<!-- Begin

showpic("이미지 이름", 이미지 넓이, 이미지 높이, "이미지 설명", "middle");

// End -->
</script>

</BODY>


출처: http://kurapa.com

댓글목록

등록된 댓글이 없습니다.

PHP
871 (18/18P)

Search

Copyright © Cmd 명령어 3.128.171.246