Citation:
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr" lang="fr">
<head>
<title> diaporama
</title>
<style type="text/css">
body{text-align:center}
</style>
<script type="text/javascript" src="exo3.js" ></script>
</head>
<body>
<div>
<h1> DIAPORAMA POISSONS </h1>
<div>
<img id="imgCourante" alt="photo affichee" src="images/poisson1.gif"/>
<script type="text/javascript">
diaporama();
</script>
<br />
<input type="image" src="images/pause.gif" onclick="pause()"/>
</div>
<div>
</div>
</div>
</body>
</html>
Citation:
var tabImages=new Array("images/poisson1.gif","images/poisson2.gif","images/poisson3.gif","images/poisson4.gif","images/poisson4.gif","images/poisson5.gif","images/poisson6.gif","images/poisson7gif.gif","images/poisson8.gif");
var numImg=0;
var interval=3000;
function diaporama(){
window.document.getElementById('imgCourante').src=tabImages[numImg];
window.setInterval("changeImage()", interval);
}
function changeImage(){
numImg=numImg+1;
window.document.getElementById('imgCourante').src=tabImages[numImg];
if(numImg==9){
numImg=0;
window.document.getElementById('imgCourante').src=tabImages[numImg];
}
}
var click;
function pause(){
click=click+1;
do{
window.clearInterval("diaporama()");
}while(click!=2);
if(click==2){
window.setTimeOut("diaporama()", 0);
}
}
Il y a surment beaucoup d'erreurs donc n'hésitez pas voila merci d'avance pour vos solutions