pro Posted November 15, 2021 Share Posted November 15, 2021 I assume you'd need some sorta javascript code to achieve this. If anyone knows the right code, please let me know. Thank you. Beyondspace 1 Link to comment
Beyondspace Posted November 15, 2021 Share Posted November 15, 2021 3 hours ago, alanx said: I assume you'd need some sorta javascript code to achieve this. If anyone knows the right code, please let me know. Thank you. what is your site url Greeting, it's BeyondSpace, I am Squarespace dev focus on provide solutions to enhance feature that squarespace.com can't provide.Feel free to check my current Squarespace Plugins Developement: Enable Pinch/Zoom on lightbox, Delivery Date Picker, Keyword HighlighterIf you find my answer fit your need, let's leave a like or upvote so others with the same issue can find their solution. Thank you Link to comment
pro Posted November 15, 2021 Author Share Posted November 15, 2021 8 minutes ago, bangank36 said: what is your site url steven.squarespace.com Beyondspace 1 Link to comment
Beyondspace Posted November 15, 2021 Share Posted November 15, 2021 1 minute ago, alanx said: https://steven.squarespace.com/clients try document.addEventListener('DOMContentLoaded', function() { const productGrid = document.querySelector('.products-flex-container .list-grid'); if (productGrid) { var productItems = productGrid.querySelectorAll('.grid-item'); for (var i = productItems.length; i >= 0; i--) { productGrid.appendChild(productItems[Math.random() * i | 0]); } } }); Greeting, it's BeyondSpace, I am Squarespace dev focus on provide solutions to enhance feature that squarespace.com can't provide.Feel free to check my current Squarespace Plugins Developement: Enable Pinch/Zoom on lightbox, Delivery Date Picker, Keyword HighlighterIf you find my answer fit your need, let's leave a like or upvote so others with the same issue can find their solution. Thank you Link to comment
Solution Beyondspace Posted November 15, 2021 Solution Share Posted November 15, 2021 1 minute ago, alanx said: Should I insert this code in Advanced > Code Injection > Header? And are there any opening and closing tags? I'm sorry, I'm a little clueless when it comes to JS code. add to footer <script> document.addEventListener('DOMContentLoaded', function() { const productGrid = document.querySelector('.products-flex-container .list-grid'); if (productGrid) { var productItems = productGrid.querySelectorAll('.grid-item'); for (var i = productItems.length; i >= 0; i--) { productGrid.appendChild(productItems[Math.random() * i | 0]); } } }); </script> tuanphan and pro 2 Greeting, it's BeyondSpace, I am Squarespace dev focus on provide solutions to enhance feature that squarespace.com can't provide.Feel free to check my current Squarespace Plugins Developement: Enable Pinch/Zoom on lightbox, Delivery Date Picker, Keyword HighlighterIf you find my answer fit your need, let's leave a like or upvote so others with the same issue can find their solution. Thank you Link to comment
tcrown86 Posted Friday at 10:56 AM Share Posted Friday at 10:56 AM @Beyondspace are you able to help me out as well please https://adventuresofrico.com/store Thanks Rico Link to comment
tuanphan Posted Saturday at 09:01 AM Share Posted Saturday at 09:01 AM 22 hours ago, tcrown86 said: are you able to help me out as well please https://adventuresofrico.com/store Thanks Rico Try changing his code to this <script> document.addEventListener('DOMContentLoaded', function() { const productGrid = document.querySelector('.ProductList-grid'); if (productGrid) { var productItems = productGrid.querySelectorAll('.ProductList-item'); for (var i = productItems.length; i >= 0; i--) { productGrid.appendChild(productItems[Math.random() * i | 0]); } } }); </script> 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
tcrown86 Posted Saturday at 04:33 PM Share Posted Saturday at 04:33 PM 7 hours ago, tuanphan said: Try changing his code to this <script> document.addEventListener('DOMContentLoaded', function() { const productGrid = document.querySelector('.ProductList-grid'); if (productGrid) { var productItems = productGrid.querySelectorAll('.ProductList-item'); for (var i = productItems.length; i >= 0; i--) { productGrid.appendChild(productItems[Math.random() * i | 0]); } } }); </script> thanks soooo much, worked well. have a great weekend. 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