
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html lang="ja-JP">
<head>
<meta http-equiv="content-type" content="text/html; charset=shift_jis">
<meta http-equiv="content-script-type" content="text/javascript">
<meta http-equiv="content-style-type" content="text/css">
<title>複数の画像を順番に表示</title>
<script type="text/javascript">
<!--
Pic = new Array("001.jpg","002.jpg","003.jpg"); //表示したい画像のURL
image = 0;
function palit(){
document.mypictures.src = Pic[image];
image++;
if( image==3 ){//使用する画像の枚数
image = 0; //表示する回数 0で無限
}
setTimeout("palit()",4000); //表示される時間の間隔(秒数)
}
window.onload = palit;
// -->
</script>
</head>
<body>
<h1>複数の画像を順番に表示</h1>
<!-- 最初に表示したい画像のファイル名を記入 -->
<img name="mypictures" src="001.jpg" alt="Pictures">
</body>
</html>
| HOME | 相互リンク集 | 初心者に分かりやすい JavaScript サンプル |
Copyright(C)2008 bisoy , All rights reserved.
Last Update: 6 / 25 / 2008 17:23:23 JST