Jump to content

How to get header logo to randomize on each refresh

Recommended Posts

Hi! I've tried a handful of scripts from other sites, but none of them have worked.

I created over 24 variations of my logo and thought it would be cool to have them be randomized after each page refresh.

I've done code injection, CSS and footer/head scripts. I also saw a youtube video that was able to easily replace the header logo per page with this script via code injection, but would need logic additional logic to get it to randomize the image:

<style>
.header-title-logo a {
content:
url(“”);
}
</style>

This is a javascript version I saw on another site however this did not work for me, and maybe cause the "id" isn't lining up or there needs an edit that includes the "a" anchor instead. I don't know much about code so I could be talking nonsense, but in theory this seems like it would be very doable but I am struggling.

Thanks!

Link to comment
  • Replies 1
  • Views 216
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Create an account or sign in to comment

You need to be a member in order to leave a comment

×
×
  • Create New...

Squarespace Webinars

Free online sessions where you’ll learn the basics and refine your Squarespace skills.

Hire a Designer

Stand out online with the help of an experienced designer or developer.