This used to work, then I tried to change it to move without button after a certain amount of time to no avail, and now I can’t get it to move with the button. Any suggestion? I have attached the gif as well.
<html>
<head>
<title>Animation</title>
<script language=”JavaScript” type=”text/javascript”>
var position, up, upper, uppermost, upperupmost;
funciont init() {
var position = 1;
var up = new image();
up.src = “balloon.gif”;
var upper = new image();
upper.src = “balloon1.gif”;
var uppermost = new image();
uppermost.src = “balloon2.gif”;
var upperupmost = new image();
upperupmost.src = “balloon3.gif”;
ball = document.getElementById(“balloon”);
}
funcion move() {
if(position == 1) {
document.balloonimg.src=up.src;
ball.balloon.style.left = 50;
ball.balloon.style.top = 200;
position = 2;
}
else if (posistion == 2) {
document.balloonimg.src=upper.src;
ball.balloon.style.left = 100;
ball.balloon.style.top = 150;
position = 3;
}
}
else if (posistion == 3) {
document.balloonimg.src=uppermost.src;
ball.balloon.style.left = 150;
ball.balloon.style.top = 100;
position = 4;
}
else if (posistion == 4) {
document.balloonimg.src=upperupmost.src;
ball.balloon.style.left = 200;
ball.balloon.style.top = 10;
position = 1;
}
}
</script>
</head>
<span id =”balloon” style =”position:absolute; left:10; top:250″>
<img name =”balloon” src=”balloon.gif”>
</span>
<form>
<input type =”button” name =”move” value =”Move”
onclick=”startMove=setInterval(‘move()’,900);”>
<input type =”button” name =”stop” value =”Stop”
onclick=”clearInterval(starMove);”>
</form>
</body>
</html>
[upl-file uuid=f4b1f9fd-0a2c-470e-b1cf-1562e2f4a015 size=10kB]balloon.gif