1. 함수(function)

연습



예제1)

<!DOCTYPE HTML>

<html>

<head>

<title>이미지 크기 증가 또는 감소</title>

<meta charset="utf-8">

<script type="text/javascript">

<!--

/*

<img src="1.jpg" width="1%"; height="1%" />

<img src="1.jpg" width="2%"; height="2%" />

<img src="1.jpg" width="3%"; height="3%" />

<img src="1.jpg" width="4%"; height="4%" />

<img src="1.jpg" width="5%"; height="5%" />

<img src="1.jpg" width="6%"; height="6%" />

<img src="1.jpg" width="7%"; height="7%" />

<img src="1.jpg" width="8%"; height="8%" />

<img src="1.jpg" width="9%"; height="9%" />

<img src="1.jpg" width="10%"; height="10%" />

*/


for(i=1;i<=10;i++) {

document.write("<img src='1.jpg' width='"+i+"%' height='"+i+"%' />");

}


for(i=9;i>0;i--) {

document.write("<img src='1.jpg' width='"+i+"%' height='"+i+"%' />");

}

-->

</script>

</head>

<body>

</body>

</html>

Posted by netyhobby
,