Hi,
I do not know any javascript so I’m hoping that someone here can help.
I have a script that uses two html picture tags and was wondering how can clicking on one change the other.
It’s a picture that acts as a button that changes another picture.
Here’s what I’ve gathered so far:
[CODE]<script type=”text/javascript”>
imgs=Array(“play1.png”,”play2.png”);
var x=0;
function hover()
{
x++;
if (x == imgs.length) x = 0;
imp.src = imgs[x];
}
/////////////////my attempt at putting scraps together///////
img=Array(“removed.png”);
var y=0;
function click()
{
if (y == img.length) y = 0;
imp.src = img[y];
}
/////////////////////////////////////////////
</script>
<img id=”imp” src=”play1.png”>
<img onmouseover=”hover()” onmouseout=”hover()” onmousedown=”click()” name=”button” src=”button.png”>
As you can see that the second image will alter the first with a hover effect. However, my sad attempt to change play1.png by clicking button.png ended in a big fat fail.
Is there a way to click button.png and change the first picture?