$(document).ready(function() {
var images = [ ‘image1.png’, ‘image2.png’, image3.png’ ];
var random = 1 + Math.floor(Math.random() * images.length);
$(‘.slider-class’).html(‘’);
});
Can someone better clarify how to go about doing this. I see the code above, but am not sure where I would place my images. Also it looks like it’s using a slider class and I don’t want this to be a slider but to simply change out an image on refresh.
Hi @melphiz6, where those image names are image1.png, image2.png etc, you would change those names and put in the path to where your images are stored. If you click on an image in the Asset Manager, you can click on the gear icon and copy the path to the image in Webflow. You would paste that path into the script you have above.
@cyberdave awesome thanks. I’ll give this a try. I’m assuming I need to put the images in a slider? Will this code then affect all other sliders on my website?