Witam mam już funkcje flip która obraca obrazek i pokazuje jego drugą strone ( tak jakby ) i z powrotem się okręca.
Ale chodzi mi o to jak zrobić żebym mógł naprzykłąd okręcać karte i za każdym razem widzieć inny obraz.

Czyli przykładowo mam 6 obrazków i chcę żeby o na się pokazywały po kolei po obrocie na karcie.

Jak zmodyfikować kod albo ewentualnie może jest prostsza funkcja od tej.

  1. <script language="JavaScript" type="text/javascript">
  2.  
  3. <!--hide
  4.  
  5. //STEP 1: PUT THIS CODE INTO THE HEAD OF YOUR DOCUMENT
  6.  
  7. var wdmax=140; //set maximum width of square image (px)
  8.  
  9. var wdmin=0; //set minimum thickness of edge-on image (px)
  10.  
  11. var inc=5; //set step change in px (wdmax-wdmin must be a multiple) )These two variables
  12.  
  13. var rate = 50; //pause between steps (in millisec) )determine flip-flop speed
  14.  
  15. var pause = 1000; //pause between flip and flop (in millisec)
  16.  
  17. var ff="flip"; //initialise whether movement starts with a "flip" (sideways) or "flop" (vertical) change.
  18.  
  19.  
  20.  
  21. function flipflop() {
  22.  
  23.  
  24. if (ff=="flip") {
  25.  
  26. var wd = document.getElementById("pic").getAttribute("height");
  27.  
  28. wd = wd - inc;
  29.  
  30. document.getElementById("pic").setAttribute("height",wd);
  31.  
  32.  
  33. if (wd==wdmin) {
  34.  
  35. document.getElementById("pic").setAttribute("src","bcard2.png"); //substitute name of your second picture
  36.  
  37. inc=-inc;
  38.  
  39. }
  40.  
  41. if (wd==wdmax) {
  42.  
  43. ff="flop";
  44.  
  45. inc=-inc;
  46.  
  47. setTimeout("flipflop()",4000);
  48.  
  49. }
  50.  
  51. else {
  52.  
  53. setTimeout("flipflop()",rate);
  54.  
  55. }
  56.  
  57.  
  58. }
  59.  
  60. else {
  61.  
  62. var ht = document.getElementById("pic").getAttribute("height");
  63.  
  64. ht = ht - inc;
  65.  
  66. document.getElementById("pic").setAttribute("height",ht);
  67.  
  68. if (ht==wdmin) {
  69.  
  70. document.getElementById("pic").setAttribute("src","bcard1.png"); //substitute name of your first picture
  71.  
  72. inc=-inc;
  73.  
  74. }
  75.  
  76. if (ht==wdmax) {
  77.  
  78. ff="flip";
  79.  
  80. inc=-inc;
  81.  
  82. setTimeout("flipflop()",2000);
  83.  
  84. }
  85.  
  86. else {
  87.  
  88. setTimeout("flipflop()",rate);
  89.  
  90. }
  91.  
  92. }
  93.  
  94.  
  95. }


Proszę o pomoc.