Guest User

Untitled

a guest
Jan 24th, 2018
53
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.12 KB | None | 0 0
  1. function preDiaporama()
  2. {
  3. calque.style.zIndex = 1;
  4. calque.style.backgroundColor = "grey";
  5. imgcourante = parseInt(img2.src[img2.src.length-5]);
  6. delay = parseInt(refresh.value)*10;
  7. compteur = delay;
  8. diaporama();
  9. }
  10.  
  11. function postDiaporama()
  12. {
  13. calque.style.zIndex = -1;
  14. calque.style.backgroundColor = "transparent";
  15. calque.style.backgroundImage = "none";
  16. }
  17.  
  18. function diaporama()
  19. {
  20. var data = "";
  21. if (compteur == delay)
  22. {
  23. compteur = 0;
  24. data = (tabImages[imgcourante-1].split("#"))[0];
  25. calque.style.backgroundImage = "url('"+data+"')";
  26. imgcourante = parseInt(imgcourante)%5 +1
  27. window.setTimeout("diaporama()", 100);
  28. }
  29. else
  30. {
  31. if (Lastkeypressed == 27)
  32. {
  33. Lastkeypressed = 0;
  34. postDiaporama();
  35. return;
  36. }
  37. compteur = parseInt(compteur)+1;
  38. window.setTimeout("diaporama()", 100);
  39. }
  40. }
  41.  
  42. -------
  43.  
  44. function escKey(event)
  45. {
  46. if (event.keyCode == 27) Lastkeypressed = 27;
  47. if (event.keyCode == 37) defiler((parseInt(img1.src[img1.src.length-5])+3)%5+1);
  48. if (event.keyCode == 39) defiler(img2.src[img2.src.length-5]);
  49. }
  50.  
  51. -------
  52.  
  53. <body onkeydown = "escKey(event)">
Add Comment
Please, Sign In to add comment