Jump to content

I need help, i cant find the errors. I have everything work except the stop button.


Leon

Recommended Posts

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<head>
<meta content="en-us" http-equiv="Content-Language" />
<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
<title>Untitled 1</title>
</head>
<body>
<script language="javascript">
var smile = new Array(6);
var rotate=0;
var start;
smile [0]= new Image();
smile [0].src="smile0.jpg";
smile [1]= new Image();
smile [1].src="smile1.jpg";
smile [2]= new Image();
smile [2].src="smile2.jpg";
smile [3]= new Image();
smile [3].src="smile3.jpg";
smile [4]= new Image();
smile [4].src="smile4.jpg";
smile [5]= new Image();
smile [5].src="smile5.jpg";
function turn(){
if(rotate==5)
rotate=0;
else
++rotate;
document.smile.src=smile[rotate].src;
}
function turningpoint() {
if (start)
clearInterval(start);
start=setInterval("turn()",400);
}
</script>
<p><img src="smile0.jpg" name="smile"/> </p>
<form>
<input type="button" name="run" value=" Run " onclick="turningpoint();"/>
<input type="button" name="Stop" value=" Stop " onclick="clearInterval(start);"/>
</form>
</body>
</html>

10.html

post-190011-0-12626200-1446759522_thumb.jpg

post-190011-0-62125400-1446759522_thumb.jpg

post-190011-0-92291000-1446759522_thumb.jpg

post-190011-0-16482300-1446759523_thumb.jpg

post-190011-0-41196300-1446759523_thumb.jpg

post-190011-0-66142900-1446759523_thumb.jpg

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...