• Diapo 2 avec gif

    Je reviens sur ce montage pour trouver le moyen de placer, en fond d'un bloc input (au clic), la vidéo en gif sur un fond coloré.

    Après recherche sur le net, on peut placer plusieurs images en fond, en positionnant chacune d'elles.

    Dans mon cas, le fond texturé est en fond et l'image animée dessus et centrée verticalement.

    Pour ceux qui voudraient essayer ce réglage, en lignes de code CSS, il faut écrire d'abord l'adresse (ou les) de l'élément animée et à la fin, l'image de fond.

    Avancement au clic.

     


    Images en 800x600px et images animées en 800x450px; leur nombre est selon votre convenance.

    Le positionnement en profondeur (z-index:): au départ, la première image (z-index:10;) est au premier plan pour être "cliquable", les autres (z-index:1;) étant dessous et passant au premier plan (z-index:20;) au clic,  pour être affichées et cliquables.

    En bleu, les adresses des images fixes; en vert, les adresses des images animées et en rouge, l'adresse du fond texturé.

    Vous remarquerez l'écriture pour des fonds multiples: background:url() les adresses dans l'ordre, séparées par une virgule, avec celle du fond en dernier; background-position: le positionnement de chacune, dans l'ordre, séparés par une virgule.


    <div id="gf"><input id="gf1" type="text" /><input id="gf2" type="text" /><input id="gf3" type="text" /><input id="gf4" type="text" /><input id="gf5" type="text" /><input id="gf6" type="text" /><input id="gf7" type="text" /><input id="gf8" type="text" />
    </div>
    <style><!--
    #gf{width:800px; height:600px; border:6px ridge grey; margin:5px auto; overflow:hidden;}
    #gf1{position:absolute; z-index:10; width:800px; height:600px; background:url(http://ekladata.com/QhYH98IDTPjLzGSO-tp89Xn8XRQ.jpg); background-size:cover; transition:all 1s linear;}
    #gf2{position:absolute; z-index:1; width:800px; height:600px; background:url(http://ekladata.com/BoSVLgRARAeoXo90phLiPsdBWIc.jpg); background-size:cover; transition:all 1s linear; opacity:0;}
    #gf3{position:absolute; z-index:1; width:800px; height:600px; background:url(http://ekladata.com/oLC2gVZ1Wh4ys3JyzXeymI2ADok.jpg); background-size:cover; transition:all 1s linear; opacity:0;}
    #gf4{position:absolute; z-index:1; width:800px; height:600px; background:url(http://ekladata.com/_V6m8l7FWuO9hBWpvrRFqrLJn64.jpg); background-size:cover; transition:all 1s linear; opacity:0;}
    #gf5{transition:all 1s linear; position:absolute; z-index:1; width:800px; height:600px; background:url(http://ekladata.com/Y4NcWFLUpusZxjGzkXm6wW0u_fo.gif) no-repeat,url(http://ekladata.com/FjlXA7mOIOoekt6Sp43ftdJJle0/marble03.jpg);  background-position:0px 75px, 0px 0px; background-size:800px 450px, 800px 600px;  opacity:0;}
    #gf6{position:absolute; z-index:1; width:800px; height:600px; background:url(http://ekladata.com/ARASsR6I5PXWJ6eayoN6U8AXZ-I.jpg); background-size:cover; transition:all 1s linear; opacity:0;}
    #gf7{position:absolute; z-index:1; width:800px; height:600px; background:url(http://ekladata.com/s6w6BktNIniUMSU3eBWetOU0MxI.jpg); background-size:cover; transition:all 1s linear; opacity:0;}
    #gf8{transition:all 1s linear; position:absolute; z-index:1; width:800px; height:600px; background:url(http://ekladata.com/oMswo0s2AC7tD3NAcDVmj7Sg-dM.gif) no-repeat,url(http://ekladata.com/FjlXA7mOIOoekt6Sp43ftdJJle0/marble03.jpg);  background-position:0px 75px, 0px 0px; background-size:800px 450px, 800px 600px; opacity:0;}

    #gf1:focus ~ #gf2, #gf2:focus ~ #gf3, #gf3:focus ~ #gf4, #gf4:focus ~ #gf5,#gf5:focus ~ #gf6,#gf6:focus ~ #gf7,#gf7:focus ~ #gf8{z-index:20; opacity:1;}
    --></style>