TOP /リクエスト(効果の変更) | 画像の入れ替え(サムネイル表示&スライドショー) |
---|
<script type="text/javascript"><!-- chimg=new Array(); chimg[0]=["01.jpg","一枚目の説明"]; chimg[1]=["02.jpg","二枚目の説明"]; chimg[2]=["03.jpg","三枚目の説明"]; //chimg[連番]=["画像ファイル名","画像の説明"]; changesec=5000; //入れ替え時間(ミリ秒) //----------------------------------------- imgno=0;imgflag=0;showcheck=0;var timeid; function changeimg(im){ if(document.all){ document.images["viewimg"].filters[0].Apply(); document.images["viewimg"].src=chimg[im][0]; document.images["viewimg"].filters[0].Play();} else{ document.images["viewimg"].src=chimg[im][0];} document.getElementById("imgmemo").innerHTML=chimg[im][1]; imgno=im; } function direction(di){ if(di=='migi') imgflag=1; else if(di=='hidari') imgflag=2; if(!showcheck){ clearTimeout(timeid); showcheck=1; showstart();} } function showstart(){ if(!showcheck)return; if(imgflag==1){ if(!document.showform.loopcheck.checked && imgno==(chimg.length-1)){ showcheck=0;return }else{ imgno++; imgno%=chimg.length; } }else{ if(!document.showform.loopcheck.checked && imgno==0){ showcheck=0;return }else{ imgno--;if(imgno<0)imgno=chimg.length-1; } } if(document.all){ document.images["viewimg"].filters[0].Apply(); document.images["viewimg"].src=chimg[imgno][0]; document.images["viewimg"].filters[0].Play();} else{ document.images["viewimg"].src=chimg[imgno][0];} document.getElementById("imgmemo").innerHTML=chimg[imgno][1]; timeid=setTimeout("showstart()",changesec);} /* himajin.moo.jp */ // --></script> <form name="showform"> <table border=1> <tr><td rowspan=2> <!--サムネイル部分ここから--> <img src="01.jpg"width="80"height="60"onclick="changeimg(0)"> <p> <img src="02.jpg"width="80"height="60"onclick="changeimg(1)"> <p> <img src="03.jpg"width="80"height="60"onclick="changeimg(2)"> <!--サムネイル部分ここまで--> </td><td> <!--表示部分以下1行--> <img src="01.jpg"id="viewimg"STYLE="filter:progid:DXImageTransform.Microsoft.Fade(Duration=2,Overlap=1)"> </td></tr> <tr><td id="imgmemo"style="font-size: 10pt;"> Explanation of a picture </td></tr> </table> <input type="button"value="<<"onclick="direction('hidari')"title="REVERSE"><input type="button"value="☆"onclick="showcheck=0"title="STOP"><input type="button"value=">>"onclick="direction('migi')"title="START"> <input type="checkbox"name="loopcheck"checked><font size=2>ループ</font> </form>