[新着] Webテンプレートを仮オープンしました
<html>
<head>
<script language="javascript">
var n=0
var image=new Array(4);
function Setimage()
{
for(i = 0 ; i<4 ; i++)
{
image[i]=new Image(200,150);
image[i].src="image"+i+".jpg";
}
}
function Scroll()
{
time=setTimeout("Scroll()",20);
document.photo.src=image[n].src;
n++
if(n>=4)
n=0;
}
function Stop()
{
clearTimeout(time);
}
</script>
</head>
<body>
<img src="image0.jpg" name="photo" width="200" height="150">
<br>
<form name="slot">
<input type="button" name="stop" value="止める" onClick="Stop()">
<input type="button" name="start" value="始める" onClick="Setimage();Scroll()">
</form>
</body>
</html><img src="image0.jpg 〜 </form>
function srcSet(name,src){
document.images[name].src=src;
}<html>
<head>
<script language="javascript">
var n=0
var image=new Array(4);
function Setimage()
{
for(i = 0 ; i<4 ; i++)
{
image[i]=new Image(200,150);
image[i].src="image"+i+".jpg";
}
}
function Scroll()
{
time=setTimeout("Scroll()",100);
function srcSet(n,src)
{
document.images[n].src=src;
n++
if(n>=4)
n=0;
}
}
function Stop()
{
clearTimeout(time);
}
</script>
</head>
<body>
<table>
<tr>
<td>
<img src="image0.jpg" name="photo" width="200"
height="150">
<br>
<form name="slot">
<input type="button" name="stop" value="止める"
onClick="Stop()">
<input type="button" name="start" value="始める"
onClick="Setimage();Scroll()">
</form>
</td>
<td>
<img src="image0.jpg" name="photo" width="200"
height="150">
<br>
<form name="slot">
<input type="button" name="stop" value="止める"
onClick="Stop()">
<input type="button" name="start" value="始める"
onClick="Setimage();Scroll()">
</form>
</td>
<td>
<img src="image0.jpg" name="photo" width="200"
height="150">
<br>
<form name="slot">
<input type="button" name="stop" value="止める"
onClick="Stop()">
<input type="button" name="start" value="始める"
onClick="Setimage();Scroll()">
</form>
</td>
</tr>
</table>
</body>
</html><html>
<head>
<title>test</title>
<script type="text/javascript">
<!--
var onCnt=0;
var image=new Array(4);
var time=setTimeout("",0);
var sw=[];
var cnt=[];
for(var i = 0 ; i<4 ; i++){
image[i]=new Image(200,150);
image[i].src="image"+i+".jpg";
}
function Scroll(name){
if(!sw[name]){
sw[name]=1;
cnt[name]=0;
onCnt++;
}
if(onCnt==1){
imgCh();
}
}
function imgCh(){
for(var name in cnt){
if(!!sw[name]){
srcSet(name,image[cnt[name]++].src);
if(cnt[name]>=4){
cnt[name]=0;
}
}
}
time=setTimeout(imgCh,20);
}
function Stop(name){
if(!!sw[name]){
sw[name]=0;
onCnt--;
}
if(onCnt==0){
clearTimeout(time);
}
}
function srcSet(name,src){
document.images[name].src=src;
}
//-->
</script>
</head>
<body>
<form>
<img src="image0.jpg" name="photo0" width="200" height="150"><br>
<input type="button" name="stop" value="止める" onClick="Stop('photo0')">
<input type="button" name="start" value="始める" onClick="Scroll('photo0')">
<hr>
<img src="image0.jpg" name="photo1" width="200" height="150"><br>
<input type="button" name="stop" value="止める" onClick="Stop('photo1')">
<input type="button" name="start" value="始める" onClick="Scroll('photo1')">
<hr>
<img src="image0.jpg" name="photo2" width="200" height="150"><br>
<input type="button" name="stop" value="止める" onClick="Stop('photo2')">
<input type="button" name="start" value="始める" onClick="Scroll('photo2')">
</form>
</body>
</html>