info:concrete5:58:randomimage

Ceci est une ancienne révision du document !


Random image

Afficher une image sélectionnée aléatoirement

Créer un bloc HTML contenant (changer les chemins des images)

<style>
.img-container {
    width: 100%;
    height: 200px;
    max-height: 240px;
    overflow: hidden;
    margin: 0;
    position: relative;
}
 
.img-container img {
    position:absolute;
    top: 50%;
    transform: translateY(-50%);
    max-width: 100%;
}
</style>
<code js>

<script> var description = [

"https://radeff.red/recettes/img/pics/15332.jpg",
"https://radeff.red/recettes/img/pics/15330.jpg"

];

var size = description.length var x = Math.floor(size*Math.random()) /* document.getElementById('limage').src=description[x]; */ document.write('<img src=“'+description[x]+'” style=“width: 100%” />'); </script> </code>

  • info/concrete5/58/randomimage.1584025064.txt.gz
  • Dernière modification : 2020/03/12 15:57
  • de radeff