TOP /このページのJavaScript | 画像の入れ替え |
---|
画像を一定時間ごとに変えています。
クリスマスの画像はChristmasMuseumさんからお借りしました。
<script type="text/javascript"><!-- treeimg = new Array("green.gif","blue.gif","red.gif","white.gif","yellow.gif");//表示する画像 I_pass="../treeimg/" //画像の位置(同一フォルダー内にあれば空欄にする) C_time=5000 //入れ替え時間(ミリ秒) document.write("<img src="+I_pass+treeimg[0]+" border='0'id='TreeImg'>") function cheng_tree(){ treeRnd = Math.floor(Math.random()*treeimg.length); document.images.TreeImg.src = I_pass+treeimg[treeRnd]; setTimeout("cheng_tree()",C_time); } setTimeout("cheng_tree()",C_time);/*himajin.moo.jp*/ // --></script>