I'm trying to make a script that will change an image several times after the image is clicked. So, if the image is clicked once, the image changes, if clicked again, the image changes again, etc. I'm trying to use a variable that increases in amount but it doesn't seem to be working for some reason. Any ideas? Thanks.
function changepic(img_name,img_src) {document[img_name].src=img_src;}
function changepic1()
{
var o = 0;
if (!o)
{
changepic('circles','circular_infinity1.png');
o++;
}
else if (o==1)
{
changepic('circles','circular_infinity_intersected1a.png');
o++;
}
else {changepic('circles','circular_infinity1a.png')}
o = !o
}