EthanK1 Posted Friday at 02:50 PM Posted Friday at 02:50 PM Hello, I am using an image gallery (slideshow: full, full bleed, large height) for my homepage and want the images autoplay in a random order, as well as be a different image every time the homepage is opened. Is there a code that can be used to do this? I have seen other forums for people doing this with other gallery types, but not for slideshow:full. Thanks for the help, Ethan
EthanK1 Posted Friday at 03:04 PM Author Posted Friday at 03:04 PM I have tried a code provided by tuanphan on elfsight.com for how to randomize a full gallery, however that method adds a large white space at below the image gallery, and I want the homepage to not scroll and only be the image gallery and header. It also sometimes loads a white screen instead of an image and takes a few seconds to go to an image. Thanks
Solution Ziggy Posted Friday at 04:36 PM Solution Posted Friday at 04:36 PM I've adjusted the code from here: Try this in Header Code Injection: <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.1/jquery.min.js"></script> <script> $( document ).ready(function() { $('.gallery-fullscreen-slideshow-list').randomize('figure.gallery-fullscreen-slideshow-item'); }); (function($) { $.fn.randomize = function(childElem) { function shuffle(o) { for(var j, x, i = o.length; i; j = Math.floor(Math.random() * i), x = o[--i], o[i] = o[j], o[j] = x); return o; }; return this.each(function() { var $this = $(this); var elems = $this.children(childElem); shuffle(elems); $this.detach(childElem); for(var i=0; i < elems.length; i++) { $this.append(elems[i]); } }); } })(jQuery); </script> If that doesn't work, can you share your website URL so I can double-check the classes on your website. EthanK1 1 Please like and upvote if my comments were helpful to you. Cheers! Zygmunt Spray Squarespace Website Designer Contact me: https://squarefortytwo.com Hire me on Upwork! 📈 SEO Space (Referral link) Ⓜ️ Will Myers' Plugins & Tutorials (Referral link) 🔌 Ghost Squarespace Plugins (Referral link) ⬛ SquareWebsites Plugins (Referral link) 🔲SQSP Themes (Referral link) ✨ Spark Plugin (Referral link) 🖼️Pinch-to-Zoom Gallery Lightbox Plugin (Referral link) ☕ Did I help? Buy me a coffee?
EthanK1 Posted Friday at 05:00 PM Author Posted Friday at 05:00 PM Unfortunately that did not work, thanks for the help. Here is the url https://www.fiveonearch.com/
Ziggy Posted Friday at 05:29 PM Posted Friday at 05:29 PM It does appear to be working when I test it, but have the slideshow auto-playing does make it harder to tell! Try disabling that and then loading the page in a private browser window multiple times to see it working. EthanK1 1 Please like and upvote if my comments were helpful to you. Cheers! Zygmunt Spray Squarespace Website Designer Contact me: https://squarefortytwo.com Hire me on Upwork! 📈 SEO Space (Referral link) Ⓜ️ Will Myers' Plugins & Tutorials (Referral link) 🔌 Ghost Squarespace Plugins (Referral link) ⬛ SquareWebsites Plugins (Referral link) 🔲SQSP Themes (Referral link) ✨ Spark Plugin (Referral link) 🖼️Pinch-to-Zoom Gallery Lightbox Plugin (Referral link) ☕ Did I help? Buy me a coffee?
EthanK1 Posted Friday at 06:00 PM Author Posted Friday at 06:00 PM (edited) It does appear to be working now, but for some reason when opening the home page, it will still show the same first image for a split second then go to a random image. It makes it look like there is a glitch. Is there a way to fix that? Thanks again for the help Edited Friday at 06:08 PM by EthanK1
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment