Jump to content

Nuimi

Recommended Posts

Can you help me with function zmen. I need change picture after click. (click one x.jpg, click two o.jpg, click three x.jpg, click four o.jpg, ...)

<script type="text/javascript">     hodnoty = ['img/nic.png','img/x.jpg','img/o.jpg'];     hrac = 2;      hrac1 = hrac ? 1 : 2;         function zmen(img,hrac)     {       if(hrac < 1)      {         img.src = (img.src!=hodnoty[0]) ? hodnoty[hrac] : hodnoty[0];      }      else      {       img.src = (img.src!=hodnoty[0]) ? hodnoty[hrac1] : hodnoty[0];      }     }     function reset(img,hrac)     {      var im, ob, i;      ob = document.getElementById('pole');      im = ob.getElementsByTagName('img');       for(i=0;i<im.length;i++)      {       zmen(im[i],0);      }     }    </script>
Edited by Nuimi
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...