Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
Advanced Search
  • 0
taydiggs

Different background image every time you visit?

Question

I am trying to create a homepage gallery wherein each time you visit, the background image is different. I am imagining that you create a gallery with some sort of code that alternates the image for each revisit to that page.

Sorry to be picky, but I do not want the background to change while you are on it, just each time you revisit the page.

Please see this website for an explanation. Each time you hit refresh, the background changes on the homepage: bddw.com

Thank you!

Edited by taydiggs
Tidy

Share this post


Link to post

Recommended Posts

  • 0

Hi Bernard, thanks so much for this. Is there any way to get this to work for the background images on a cover page?

This is the link to my home page - https://koushik-sarkar.squarespace.com/

Like I said, I'm using a cover page to achieve this layout. I tried modifying your code to work on it but to no avail. Here it is -


var image=document.getElementsByClassName("sqs-slice-gallery-item content-fill sqs-gallery-design-stacked-slide loaded sql-active-slide");

Any help would be much appreciated! Thanks in advance.

Share this post


Link to post
  • 0

Hi-@bernardwest I am trying to do this with the homepage banner; that is: I would like a different image to show each time the user visits the page.

I tried the code in the code injection--> footerthen tried to put it in the code injection--> header (due to I am not changing the background image but I am changing the header banner.)

Share this post


Link to post
  • 0

Is there a way to adapt this code so it will work for my Cover Page? Right now my page is using a slideshow, but I would prefer it so that every time someone visits my website, there is a different image that is displayed on my cover page. Thanks!

www.daveangilella.com for reference, using the Forte template.

Share this post


Link to post
  • 0

Is there a way to adapt this code so it will work for my Cover Page? Right now my page is using a slideshow, but I would prefer it so that every time someone visits my website, there is a different image that is displayed on my cover page. Thanks!

www.daveangilella.com for reference, using the Forte template.

Share this post


Link to post
Guest
This topic is now closed to further replies.

×
×
  • Create New...