Jump to content

Randomize images on Cover Pages?

Recommended Posts

Hi,

For a long time I've had my gallery on my frontpage running in a random sequence. Works great! But I'm trying to move to a Cover Page as my frontpage, as it allows me to make fullscreen images, which is nice and impactful. But I cannot make the image collection on this page randomize. I've had a programmer look at it, and the Cover Pages are not constructed in the same way as normal pages with galleries, and so the same tricks don't work on both...

So, has anybody (successfully) managed to randomise the selection of images you have running as fullscreen background images on Cover Pages?

Thanks!
/Kasper

Link to comment
  • 1 month later...
  • 2 weeks later...
On 3/9/2020 at 3:16 PM, Kahrmann said:

Same with me. Would be interested in a solution too.

 

 

On 2/5/2020 at 10:55 PM, KCPH said:

Hi,

For a long time I've had my gallery on my frontpage running in a random sequence. Works great! But I'm trying to move to a Cover Page as my frontpage, as it allows me to make fullscreen images, which is nice and impactful. But I cannot make the image collection on this page randomize. I've had a programmer look at it, and the Cover Pages are not constructed in the same way as normal pages with galleries, and so the same tricks don't work on both...

So, has anybody (successfully) managed to randomise the selection of images you have running as fullscreen background images on Cover Pages?

Thanks!
/Kasper

You can create normal page, then hide Header/Footer/Logo/Navigation with custom CSS.

You can create page first, then share link, we can give the CSS

Email me if you have need any help (free, of course.). Answer within 24 hours. 
Or send to forum message

How to: Setup Password & Share url Insert Custom CSS - Page Header - Upload Custom Font - Upload File - Find Block ID - Contact Customer Care

Link to comment
  • 1 month later...

I used this code in my cover page which has successfully allowed me to randomize images each time someone refreshes the page. But the images are no longer responsive. Some are awkwardly cropped, and some are too small to fit the screen. Is there a fix? or an additional code to add into this code to allow each image to be responsive to various screen sizes? 

 

<script language="JavaScript">
<!--

function random_imglink(){
var myimages=new Array()
//specify random images below. You can have as many as you wish
myimages[1]="http://whatever.com/picture.jpg"
myimages[2]="http://whatever.com/image.jpg"
myimages[3]="http://whatever.com/graphic.jpg"

var ry=Math.floor(Math.random()*myimages.length)
if (ry==0)
ry=1
document.write('<img src="'+myimages[ry]+'" border=0>')
}
random_imglink()
//-->
</script>
Link to comment
  • 7 months later...
On 3/19/2020 at 4:33 AM, tuanphan said:

 

You can create normal page, then hide Header/Footer/Logo/Navigation with custom CSS.

You can create page first, then share link, we can give the CSS

@tuanphan I know it's a long shot if you're still seeing my response; But I've made a normal page and have been able to hide header, footer, logo, navigation but I'm not sure how to add multiple images as backgrounds. Do you know how can I add multiple photos as backgrounds in a normal page AND THEN randomize them?

Link to comment

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.