| 큰 이미지를 화면크기에 맞게 배치시켜주는 스크립트 입니다 |
|
|
 홈페이지 |
22년 전 |
아주 유용하겠죠?
예문의 창크기를 조절해서 쓰세요 ~
<!-- 아래 스크립트르 HEAD 부분에 붙여 넣으세요 --->
<SCRIPT LANGUAGE="JavaScript">
<!--
function showpic(src, w, h, alt, aln, pw, ph, bw, bh) {
if (src == null) return;
var iw, ih;
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+'">');
}
// -->
</script>
</HEAD>
<BODY BGCOLOR="#FFFFFF">
<!--- 2. 아래와 같은 방법으로 스크립트를 BODY 에 붙여 넣습니다-->
<script language="javascript">
showpic("crowd.gif", 362, 113, "A crows of people", "middle");
//showpic("이미지명", 가로크기, 세로크기, "이미지설명", "가로정열");
</script>
|
|
추천 : 410 |
추천
목록
|
|