Streaming live at 10am (PST)

Image change on page refresh


#1

$(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.



#2

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.

It would really help if you could share the read only link to your site, and then it will help to get this working faster :smile: http://help.webflow.com/faq/how-do-i-share-my-sites-read-only-link

I hope this helps..


#3

@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?

If it's helpful here is my link. I just don't have much up yet.
https://preview.webflow.com/preview/feinberghanson?preview=a2da3ca34b20844ac3644eec3959a681


#4

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.