My point is to build a pool shot, by moving horizontaly a cue stick (taco.jpg) and then the ball (ball.gif), having it return to original position
[code=php]
<script>
function Changeposition(whattomove,wheretomove) {
eval(“document.”+whattomove+”.style.left”) = wheretomove;
}
function Tacada() {
for (var i=111; i<=211; i++){ setTimeOut(Changeposition(“taco”,i),10)}
for (var i=111; i>=111; i–){ setTimeOut(Changeposition(“taco”,i),10)}
for (var i=0; i>=-150; i–){ setTimeOut(Changeposition(“ball”,i),10)}
for (var i=-150; i<=0; i++){ setTimeOut(Changeposition(“ball”,i),10)}
}
</script>
</head>
<body background=”bg.jpg”>
<img border=”0″ name=”ball” src=”ball.gif” style=”position: absolute; left: 0; top: 0; z-index: 1″ width=”111″ height=”121″>
<img border=”0″ name=”taco” src=”taco.jpg” style=”position: absolute; left: 111; top: 56; z-index: 1″ width=”830″ height=”20″ onClick=”Tacada()”>