I have got this code that changes an image from one image to the another when a trigger image is pressed. The thing is a want a tables background to change everytime the trigger image is pressed. I would be very grateful if any one could help me out. Thanks.
----------------------------------------
<script>
arraySrc = new Array();
arraySrc[0] = "images/taha_head.gif";
arraySrc[1] = "images/taha_head2.gif";
var x1 = 0;
function change1(target)
{
if(x1 >= arraySrc.length)
{
x1 = 0;
}
document.images[target].src = arraySrc[x1];
x1++;
}
</script>
// trigger image code
<img SRC="images/arrow_logo.gif" height=100 width=100 onclick="change1('ben');" >
<img name="ben" src="images/taha_head.gif"></td>
-----------------
----------------------------------------
<script>
arraySrc = new Array();
arraySrc[0] = "images/taha_head.gif";
arraySrc[1] = "images/taha_head2.gif";
var x1 = 0;
function change1(target)
{
if(x1 >= arraySrc.length)
{
x1 = 0;
}
document.images[target].src = arraySrc[x1];
x1++;
}
</script>
// trigger image code
<img SRC="images/arrow_logo.gif" height=100 width=100 onclick="change1('ben');" >
<img name="ben" src="images/taha_head.gif"></td>
-----------------