javascript
1<!DOCTYPE html> 2<html lang = "ja"> 3<head> 4<title>一定時間で新ウィンドウの画像が変わる</title> 5<meta charset = "utf-8"> 6<script> 7var win; 8var timer; 9var num = 1; 10 11function start(){ 12 timer = setInterval("dClock()",1000); 13} 14function dClock(){ 15 win = open('画像が変わる images/kyocotan' num +'.jpg',"win_kyoctan",'width=100 height=200 top=100 left=400'); 16 num++; 17 if(num > 5); 18 num = 1; 19} 20} 21 function stop(){ 22 win.window.close(); 23 clearInterval(timer); 24 num = 1; 25} 26</script> 27</head> 28<body> 29<input type = "button" name="start_btm" value="start" onclick = "sClock()"> 30<input type = "button" name="stop_btm" value="stop" onclick = "sClock()"> 31</body> 32</html>
一秒ごとに画像を変えるプログラムを書いたのですが動かないです、どなたかわかる方教えてもらえませんか?
回答2件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2019/07/21 14:45
2019/07/21 14:45
2019/07/22 00:19
2019/07/22 00:30