This page automatically calls the function moveit() on load. moveit() moves an image (a line) up and down. I want this to happen continuously; however, I do not know how to make my function restart. Currently, I am making the page reload every time the line reaches the bottom of the page. This takes a lot of time though, so I'd like to restart the function instead. Thanks!
<html manifest="manifest.appcache">
<body onload="moveit(8)">
<img style="margin: 0 auto;" src="http://media.tumblr.com/593368ddaf4ad655258a076f959856fa/tumblr_inline_mgmuspje6G1re2ao1.bmp"></img>
<style type="text/css">
.moveimage { position:absolute; right:0; bottom:0; z-index:2 }
}
</style>
<script language="JavaScript">
function moveit(spot)
{
if (document.getElementById("image1"))
{
var picture=document.getElementById("image1").style;
if (spot<328)
{
picture.bottom= spot;
spot+=3.7;
setTimeout('moveit('+spot+')',15);
}
if (spot>328)
{
picture.top= spot;
spot+=1.25;
setTimeout('moveit('+spot+')',10);
}
if (spot>650)
{
window.location.reload();
}
}
}
</body>
</script>
</html>