Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function preDiaporama()
- {
- calque.style.zIndex = 1;
- calque.style.backgroundColor = "grey";
- imgcourante = parseInt(img2.src[img2.src.length-5]);
- delay = parseInt(refresh.value)*10;
- compteur = delay;
- diaporama();
- }
- function postDiaporama()
- {
- calque.style.zIndex = -1;
- calque.style.backgroundColor = "transparent";
- calque.style.backgroundImage = "none";
- }
- function diaporama()
- {
- var data = "";
- if (compteur == delay)
- {
- compteur = 0;
- data = (tabImages[imgcourante-1].split("#"))[0];
- calque.style.backgroundImage = "url('"+data+"')";
- imgcourante = parseInt(imgcourante)%5 +1
- window.setTimeout("diaporama()", 100);
- }
- else
- {
- if (Lastkeypressed == 27)
- {
- Lastkeypressed = 0;
- postDiaporama();
- return;
- }
- compteur = parseInt(compteur)+1;
- window.setTimeout("diaporama()", 100);
- }
- }
- -------
- function escKey(event)
- {
- if (event.keyCode == 27) Lastkeypressed = 27;
- if (event.keyCode == 37) defiler((parseInt(img1.src[img1.src.length-5])+3)%5+1);
- if (event.keyCode == 39) defiler(img2.src[img2.src.length-5]);
- }
- -------
- <body onkeydown = "escKey(event)">
Add Comment
Please, Sign In to add comment