dfesenmyer Posted June 13, 2023 Share Posted June 13, 2023 Can you randomize the portfolio layout? so that the projects load in a different order on reload of the "portfolio" page. Link to comment
tuanphan Posted June 15, 2023 Share Posted June 15, 2023 Can you share link to portfolio page? We can check easier Email me if you have need any help (free, of course.). Answer within 24 hours. Or send to forum message Contact Customer Care - Learn CSS - Buy me a coffee (thank you!) Link to comment
dfesenmyer Posted June 27, 2023 Author Share Posted June 27, 2023 https://fezlab2.squarespace.com/ pw: mingus12! I'm hoping to have the order of the display change on load? so each time someone comes to that page and different project will be first. Link to comment
tuanphan Posted June 28, 2023 Share Posted June 28, 2023 Try adding this code to Code Injection > Footer <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.3/jquery.min.js"></script> <script> document.addEventListener('DOMContentLoaded', function() { const productGrid = document.querySelector('div#gridThumbs'); if (productGrid) { var productItems = productGrid.querySelectorAll('.grid-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 Contact Customer Care - Learn CSS - Buy me a coffee (thank you!) Link to comment
frescova Posted November 17, 2023 Share Posted November 17, 2023 Does this code work for a single portfolio or does it affect all portfolios on a site? Link to comment
frescova Posted November 17, 2023 Share Posted November 17, 2023 Looks like it's working - I just added it to the code injection for the single portfolio page so it does not affect my other portfolios. Thanks! tuanphan 1 Link to comment
tcrown86 Posted June 25 Share Posted June 25 On 6/28/2023 at 11:39 AM, tuanphan said: Try adding this code to Code Injection > Footer <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.3/jquery.min.js"></script> <script> document.addEventListener('DOMContentLoaded', function() { const productGrid = document.querySelector('div#gridThumbs'); if (productGrid) { var productItems = productGrid.querySelectorAll('.grid-item'); for (var i = productItems.length; i >= 0; i--) { productGrid.appendChild(productItems[Math.random() * i | 0]); } } }); </script> Hi, is there a way to make this code work on my site? https://rico-x.com/projects-x https://rico-x.com/united-colours-of-citrus Thanks 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