posted 10 years ago
The turtle was going left to right.
Now he just sets there.
I want him to dive.
Would really like for him to dive and curve to right.
If I can find the command to make him go down, I believe I can make him turn.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Turtle Dive</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script language="JavaScript" type="text/JavaScript">
<!--
var row = 0;
//function move turtle towards the bottom
function moveTurtleDown()
{
//This accesses the graphic on the page and moves its position
document.getElementById("turtle").style.left=585+(row*12);
if (row < 10)
{
//You only need 10 iterations to make it to the bottom of the river
row++;
}
window.setTimeout("moveTuttleDown();",130);
//Recursive function that gives a slight delay in time to look more fulid
}
}//end of moveTuttleDown Function
//-->
</script>
</head>
<body bgcolor="#FFFFCE" >
<div align="center">
<h1><strong>Using DHTML</strong></h1>
<h2><strong>To Make the Turtle Dive</strong><h2>
<div id="Background" style="position:absolute; left:77px; top:100px; visibility:visible; z-index:1; width: 100px; height: 103px;"><img src="backgroundIntro.gif" width="851" height="258"></div>
<div id="turtle" style="position:absolute; left:300px; top:260px; visibility:visible; z-index:2; width: 100px; height: 103px;"><img border="0" src="turtle.gif" width="45" height="53"></div>
</div>
<form>
<input type="button" id="sbutton" value="submit" onClick="moveTurtleDown();">
</form>
</body>
</html>