MarkNL
04-25-2003, 10:00 AM
I have made this code to move an image:
--------------------
<script>
function move(dif)
{
map.style.left = map.style.left + dif;
}
</script>
<a onclick="move(10);"><img src="left.gif"></a>
<a onclick="move(-10);"><img src="right.gif"></a>
<img name="map" src="image.gif" style="position:absolute">
-------------------
But it only works the first time you click right or left, and after that it gives a javascript error.
How could i fix this?
--------------------
<script>
function move(dif)
{
map.style.left = map.style.left + dif;
}
</script>
<a onclick="move(10);"><img src="left.gif"></a>
<a onclick="move(-10);"><img src="right.gif"></a>
<img name="map" src="image.gif" style="position:absolute">
-------------------
But it only works the first time you click right or left, and after that it gives a javascript error.
How could i fix this?