Jump to content

Randomly show 4 of 12 buttons/links on a rotating basis

Recommended Posts

Posted

Hello!

I am trying to have 4 of 12 buttons/links show at a time on my page and have the order of buttons be random each time. For example, one day might have Link 7, Link 3, Link 2, Link 4 and another day Link 5, Link 10, Link 8, Link 2, etc.

I do not have the pages set-up on my website yet, because I am trying to see if this is possible first.

Thank you in advance!

 

  • Replies 2
  • Views 1.3k
  • Created
  • Last Reply

Top Posters In This Topic

Posted

I don't have a solution but some thoughts.

I'm thinking this might be possible. I'd approach the problem with two sections.

The first section would contain three buttons. The buttons can just be the standard button that is created when you add the button block, no need to customize.

The other section would be added as the last section of the page. Build your 12 buttons there. Hide the section with CSS. Now with JavaScript loop three times, randomly select a button, replace a button in the other section with the randomly selected button.

This effect would require the business plan or above to run JavaScript.

Find my contributions useful? Please like, upvote, mark my answer as the best ( solution ), and see my profile. Thanks for your support! I am a Squarespace ( and other technological things ) consultant open for new projects.

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.