hiya
i have a bit of code that works well, goes though 8 images fine.. named 1.jpg through to 8.jpg
.................................................. .......
<script type="text/javascript">
<!--
function move(depth) {
if (depth < 8) {
depth++;
document.getElementById("move").src = depth + ".jpg";
}
setTimeout("move("+depth+");",30);
}
//-->
</script>
.................................................. ......
<a href="#" onclick="move(0)">SPIN</a>
.................................................. ......
however
if i change it to this
.................................................. .....
<script type="text/javascript">
<!--
function move(depth,stop) {
if (depth < stop) {
depth++;
document.getElementById("move").src = depth + ".jpg";
}
setTimeout("move("+depth+");",30);
}
//-->
</script>
.................................................. .......
<a href="#" onclick="move(0,6)">SPIN</a>
.................................................. .......
by adding a second variable in "stop" it stops the script completely.
normall as the first example it would show images from 1 to 8
but with the stop in it should show from 1 to 6,, but its not working.
i am new to javascript btw
can you see whats wrong?
thanks
shaz x
__________________
mysql_connect("localhost", "brain", "sharon") or die(mysql_error());
mysql error: brain doesn't exist!
Last edited by Sharon_leic; 02-22-2008 at 09:20 PM..
|