AirV's Blog

Just another blog

Diaporama

Des solutions pour créer un diaporama à partir d’un répertoire contenant des photos :

  • Xnview
  • Script php
  • <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
    
    <html>
    
    <head>
    
    <title>Diaporama</title>
    
    </head><body>
    
    <DIV ID=ejs_photo_box></div>
    
    <script type="text/javascript">
    
    ejs_photo = new Array;
    
    <?
    
    $a = 0;
    
    $handle = opendir("photos");
    
    while (($file = readdir())!=false) {
    
    clearstatcache();
    
    if($file!=".." && $file!=".")
    
    {
    
    echo "ejs_photo[$a] = 'photos/$file';
    
    ";
    
    $a++;
    
    }
    
    }
    
    closedir($handle);
    
    ?>
    
    function ejs_aff_photos(num)
    
    {
    
    if(document.getElementById)
    
    {
    
    ejs_fin = "";
    
    if(num!=0)
    
    ejs_fin += "<A href=# onClick='ejs_aff_photos("+(num-1)+");return(false)'>< Précédent</A>     ";
    
    if(num!=(ejs_photo.length-1))
    
    ejs_fin += "<A href=# onClick='ejs_aff_photos("+(num+1)+");return(false)'>Suivant ></A>";
    
    document.getElementById("ejs_photo_box").innerHTML = "<CENTER><IMG src='"+ejs_photo[num]+"' BORDER=0><BR>"+ejs_fin+"</CENTER>";
    
    }
    
    }
    
    window.onload = new Function("ejs_aff_photos(0)")
    
    </script></script>
    
    </body>
    
    </html>

mardi 29 janvier 2008 Posté par à 11:04 | Logiciel | pas de commentaire