mportch Posted April 1 Share Posted April 1 (edited) Hi, Would there be any way to code this page so the images appeared in random order each time a person visited the site? Thanks in advance. https://smilodon-ocelot-my5f.squarespace.com Edited April 1 by mportch Link to comment
Solution tuanphan Posted April 5 Solution Share Posted April 5 Try adding to Settings > Advanced > Code Injection > Footer <script> document.addEventListener('DOMContentLoaded', function() { const productGrid = document.querySelector('.gallery-masonry .gallery-masonry-wrapper'); if (productGrid) { var productItems = productGrid.querySelectorAll('figure'); for (var i = productItems.length; i >= 0; i--) { productGrid.appendChild(productItems[Math.random() * i | 0]); } } }); </script> mportch 1 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
mportch Posted April 5 Author Share Posted April 5 Fantastic - that seems to work - thank you! Link to comment
mportch Posted May 23 Author Share Posted May 23 (edited) Hi, The images on DESKTOP version still click to a new window. But they no longer click to a new window on MOBILE version. Do you know how to fix this? https://smilodon-ocelot-my5f.squarespace.com/gallery Edited May 23 by mportch Link to comment
tuanphan Posted May 25 Share Posted May 25 On 5/23/2023 at 5:16 PM, mportch said: Hi, The images on DESKTOP version still click to a new window. But they no longer click to a new window on MOBILE version. Do you know how to fix this? https://smilodon-ocelot-my5f.squarespace.com/gallery You have this code in Code Injection or Page Header, it disabled click event <style> @media screen and (max-width: 767px) { #page .gallery a { pointer-events: none; } </style> 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
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment