1級 / 平成26年度(2014) 第3回試験
問32
次の HTML で JavaScript が実行された場合、実現されるものはどれか。適切なものを以下より 1 つ選択しなさい。
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Animation</title>
<style type="text/css">
#wrap {
width: 600px;
}
#header {
border: 1px solid #A33; color: #33C; background-color: #FDE;
}
#content {
border: 1px solid #3A3; height: 50px; color: #33C; background-color: #EFE; overflow: hidden;
}
</style>
<script type="text/javascript">
var h;
doMove();
function goMove() {
h++;
if( h <= 400 ) {
document.getElementById("content").style.height = h + 'px';
}
}
function doMove() {
h = 0;
setInterval(goMove, 10);
}
</script>
</head>
<body>
<div id="wrap">
<h1 id="header">ヘッダ</h1>
<div id="content">
<p>メインコンテンツ</p>
</div>
</body>
</html>