I'm trying to display 80 images from a folder by using Javascript Fotorama image gallery.
Instead of writing each image directory is there any way to display them all by using an array? Need to display images from 1 to 80.
Image names will stay the same for example - image_1.jpeg, image_2.jpeg, etc
<script>
$('.fotorama').fotorama({
data: [
{img: 'img/slides/image_1.jpeg'},
{img: 'img/slides/image_2.jpeg'},
{img: 'img/slides/image_3.jpeg'}
]
});
</script>
A simple
forloop will do it. Create your array like so:Then pass to
fotorama: