Bonjour,
Merci pour ce forum.
Il peut me sauver du désespoir de ne pas être développeur...
J'ai créé un diaporama perso en glanant des codes ici et là.
Il ne manque que le fondu enchaîné, et je ne comprends rien !
Voici mes codes - dans le head> :
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41
| <script type="text/javascript" language="JavaScript">
var current = 0;
function next(){ // forward one image
if(document.formname.slide[current+1]){
document.images.show.src = document.formname.slide[current+1].value;
document.formname.slide.selectedIndex = ++current;}
else{first();}}
function previous(){ // back on image
if((current-1) >= 0){
document.images.show.src = document.formname.slide[current-1].value;
document.formname.slide.selectedIndex= --current;}
else{last();}}
function first(){ // jump to first image
current=0;
document.images.show.src = document.formname.slide[0].value;
document.formname.slide.selectedIndex=0;}
function last(){ // this is jump to last image
current=(document.formname.slide.length-1);
document.images.show.src = document.formname.slide[current].value;
document.formname.slide.selectedIndex=current;}
function ap(text){ // this controls the auto-play and/or auto-stop
document.formname.slidebutton.value=(text == "Stop") ? "Start" : "Stop";
rotate();}
function change(){ // this is for the pulldown menu
current=document.formname.slide.selectedIndex;
document.images.show.src = document.formname.slide[current].value;}
function rotate() {
if (document.formname.slidebutton.value == "Stop") {
current = (current == document.formname.slide.length-1) ? 0 : current+1;
document.images.show.src = document.formname.slide[current].value;
document.formname.slide.selectedIndex = current;
window.setTimeout("rotate()", 4000);}}
// End -->
</script> |
et dans le body> :
<form name="formname" action="diaporama">
avec un tableau dans lequel une première image
<img src="image0.jpg" name="show">
Puis :
1 2 3 4
| <select id="slide" onchange="change()"
<option value="image1.jpg">blabla</option>
<option value="image2.jpg">blabla</option>
<option value="image3.jpg">blabla</option> |
etc.
La suite n'a pas d'intérêt je crois...
Que dois-je faire, Docteur, pour que les enchaînements soient fondus ?
Merci infiniment !
Yvo
Partager