• Diapo 7

    Un diaporama est une présentation d'images, dans notre cas, qui peut soit:

    - tourner tout seul avec ou sans arrêt possible de l'animation.

    - présenter des images à animer au clic ou au survol, directement ou par l'intermédiaire de boutons ou vignettes.

    Pour le moment, je ne vois que ces possibilités...

    Faire tourner un diaporama sans intervention du visiteur me semble être devant la télévision, ce qui n'est pas mon choix.

    En ajoutant un arrêt de l'animation, c'est déjà plus "participatif" et permet au visiteur de s'arrêter sur les images qui l'intéressent.

    Présenter un ensemble d'images en vignettes, par exemple, permet au visiteur de visualiser celles qu'il remarque, au survol ou au clic.

    Le clic a un inconvénient et un avantage: il faut une action pour animer l'élément et une action pour le faire revenir à l'état premier.

    Le survol a un inconvénient et un avantage: il faut maintenir le curseur sur l'élément pour l'animer; en sortir fait revenir l'élément à l'état premier.

    Nous avons donc le choix de la commande; reste ensuite, l'animation proprement dite.

    La plupart du temps, nous voyons des diaporamas par défilement mais d'autres façons de faire sont possibles (agrandissement, opacité, rotation...)

    D'autre part, le ratio (rapport largeur/hauteur) de vos images est souvent: 4/3 (ancienne taille des écrans télévision) et 16/9 (plus panoramique) et toutes les variantes approchantes; ceci demande donc d'adapter les codes pour le ratio de vos images.

    Vous avez donc le choix dans la création de votre diaporama; en voici un par agrandissement central, avec arrêt au survol, en 4/3 ... pourquoi pas !

    Cependant, le code peut paraître compliqué, car il faut une animation particulière pour chaque image, mais répétitif. Ne changez que les adresses des images...

     


    <div style="position: relative; margin: 30px auto; width: 1000px; height: 750px; border: 6px ridge white; box-shadow: 4px 4px 6px black; text-align: left;">
    <p id="bb0">&nbsp;</p>
    <img id="bb1" src="http://ekladata.com/sW3RjzIHsaAu6SZ0WjqhBb7iSC0@1000x750.jpg" alt="" />

    <img id="bb2" src="http://ekladata.com/Ol4R38pmU247NQf0S_uzWyF-eeU@1000x750.jpg" alt="" />

    <img id="bb3" src="http://ekladata.com/QOo2nGPrY1zruHUpkT9lqxtQvzc@1000x750.jpg" alt="" />

    <img id="bb4" src="http://ekladata.com/kYABWGTLj2GrgFMGpxyvZj38p2g@1000x750.jpg" alt="" />

    <img id="bb5" src="http://ekladata.com/sp-ahKXyKzgTOS6F9Jm5sgTLu-g@1000x750.jpg" alt="" />

    <img id="bb6" src="http://ekladata.com/VUWl6XIaWvqlZTA3OJAvFnVhm0g@1000x750.jpg" alt="" /></div>
    <style><!--
    #bb0{position:absolute; z-index:10; width:1000px; height:750px;}
    #bb0:hover ~ #bb1,#bb0:hover ~ #bb2,#bb0:hover ~ #bb3,#bb0:hover ~ #bb4,#bb0:hover ~ #bb5,#bb0:hover ~ #bb6{animation-play-state:paused;}
    #bb1{position:absolute; z-index:1;}
    #bb2{position:absolute; z-index:2; animation:haut2 20s 0s linear infinite normal; animation-play-state:running;}
    @keyframes haut2{
    0%{width:0px; height:0px; transform:translate(500px,375px);}
    5%{width:0px; height:0px; transform:translate(500px,375px);}
    10%{width:1000px; height:750px; transform:translate(0px,0px);}
    30%{width:1000px; height:750px; transform:translate(0px,0px);}
    40%{width:0px; height:0px; transform:translate(500px,375px);}
    100%{width:0px; height:0px; transform:translate(500px,375px);}}
    #bb3{position:absolute; z-index:3; animation:haut3 20s 0s linear infinite normal; animation-play-state:running;}
    @keyframes haut3{
    0%{width:0px; height:0px; transform:translate(500px,375px);}
    20%{width:0px; height:0px; transform:translate(500px,375px);}
    25%{width:1000px; height:750px; transform:translate(0px,0px);}
    45%{width:1000px; height:750px; transform:translate(0px,0px);}
    55%{width:0px; height:0px; transform:translate(500px,375px);}
    100%{width:0px; height:0px; transform:translate(500px,375px);}}
    #bb4{position:absolute; z-index:4; animation:haut4 20s 0s linear infinite normal; animation-play-state:running;}
    @keyframes haut4{
    0%{width:0px; height:0px; transform:translate(500px,375px);}
    35%{width:0px; height:0px; transform:translate(500px,375px);}
    40%{width:1000px; height:750px; transform:translate(0px,0px);}
    60%{width:1000px; height:750px; transform:translate(0px,0px);}
    70%{width:0px; height:0px; transform:translate(500px,375px);}
    100%{width:0px; height:0px; transform:translate(500px,375px);}}
    #bb5{position:absolute; z-index:5; animation:haut5 20s 0s linear infinite normal; animation-play-state:running;}
    @keyframes haut5{
    0%{width:0px; height:0px; transform:translate(500px,375px);}
    50%{width:0px; height:0px; transform:translate(500px,375px);}
    55%{width:1000px; height:750px; transform:translate(0px,0px);}
    75%{width:1000px; height:750px; transform:translate(0px,0px);}
    85%{width:0px; height:0px; transform:translate(500px,375px);}
    100%{width:0px; height:0px; transform:translate(500px,375px);}}
    #bb6{position:absolute; z-index:5; animation:haut6 20s 0s linear infinite normal; animation-play-state:running;}
    @keyframes haut6{
    0%{width:0px; height:0px; transform:translate(500px,375px);}
    65%{width:0px; height:0px; transform:translate(500px,375px);}
    70%{width:1000px; height:750px; transform:translate(0px,0px);}
    90%{width:1000px; height:750px; transform:translate(0px,0px);}
    100%{width:0px; height:0px; transform:translate(500px,375px);}}
    --></style>