[Javascript] Diaporama avec plus de 15 images?

Diaporama avec plus de 15 images? [Javascript] - Divers - Programmation

Marsh Posté le 16-05-2006 à 09:26:29    

Bonjour, j'ai trouvé ce code de diaporama/visionneuse d'image qui me convient et qui fonctionne.  
Cependant, il ne fonctionne plus après un nombre de 15 images! Quelqu'un a une idée? C'est peut être tout simple.. mais trop compliqué pour moi!
Merci d'avance pour votre aiden voila l'url du script, puis le détail du code.
 
http://pagesperso.accesinternet.la [...] 987669141/
 

Citation :


 
<SCRIPT LANGUAGE="JavaScript">
var rotate_delay = 5000;
current = 0;
function next() {
if (document.slideform.slide[current+1]) {
document.images.show.src = document.slideform.slide[current+1].value;
document.slideform.slide.selectedIndex = ++current;
   }
else first();
}
function previous() {
if (current-1 >= 0) {
document.images.show.src = document.slideform.slide[current-1].value;
document.slideform.slide.selectedIndex = --current;
   }
else last();
}
function first() {
current = 0;
document.images.show.src = document.slideform.slide[0].value;
document.slideform.slide.selectedIndex = 0;
}
function last() {
current = document.slideform.slide.length-1;
document.images.show.src = document.slideform.slide[current].value;
document.slideform.slide.selectedIndex = current;
}
function ap(text) {
document.slideform.slidebutton.value = (text == "Stop" ) ? "Start" : "Stop";
rotate();
}
function change() {
current = document.slideform.slide.selectedIndex;
document.images.show.src = document.slideform.slide[current].value;
}
function rotate() {
if (document.slideform.slidebutton.value == "Stop" ) {
current = (current == document.slideform.slide.length-1) ? 0 : current+1;
document.images.show.src = document.slideform.slide[current].value;
document.slideform.slide.selectedIndex = current;
window.setTimeout("rotate()", rotate_delay);
   }
}
//  End -->
</script>
 
 


 
 
Puis dans BODY
 

Citation :


 
<form name=slideform>
<table cellspacing=1 cellpadding=4 bgcolor="#000000">
<tr>
<td align=center bgcolor="white">
<b>Image Slideshow</b>
</td>
</tr>
<tr>
<td align=center bgcolor="white" width=200 height=150>
<img src="mon_image1.jpg" name="show">
</td>
</tr>
<tr>
<td align=center bgcolor="#C0C0C0">
<select name="slide" onChange="change();">
<option value="mon_image1.jpg" selected>Nom de l'image 1
<option value="mon_image2.jpg">Nom de l'image 2
<option value="mon_image3.jpg">Nom de l'image 3
<option value="mon_image4.jpg">Nom de l'image 4
</select>
</td>
</tr>
<tr>
<td align=center bgcolor="#C0C0C0">
<input type=button onClick="first();" value="|<<" title="Beginning">
<input type=button onClick="previous();" value="<<" title="Previous">
<input type=button name="slidebutton" onClick="ap(this.value);" value="Start" title="AutoPlay">
<input type=button onClick="next();" value=">>" title="Next">
<input type=button onClick="last();" value=">>|" title="End">
</td>
</tr>
</table>
</form>
 

Reply

Marsh Posté le 16-05-2006 à 09:26:29   

Reply

Marsh Posté le 16-05-2006 à 09:28:15    

Au passage, c'est également le diaporama que lycos propose en tant qu'outil pour webmasters!

Reply

Marsh Posté le 16-05-2006 à 09:31:39    

Lycos a changé un morceau du script:
 
function rotate() {  
if (document.slideform.slidebutton.value == "Stop" ) {  
current = (current == document.slideform.slide.length-1) ? 0 : current+1;  
 
En fait, seul un point d'interrogation a été rajouté ici, est-ce une solution au problème?

Reply

Sujets relatifs:

Leave a Replay

Make sure you enter the(*)required information where indicate.HTML code is not allowed