CallumT Posted February 2 Posted February 2 Hello, I have a gallery reel which I'd like to auto-scroll. I currently have a script that does work, however, it makes me unable to edit the site once its enabled. Is there any way around that? Here is my script: <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.7.0/jquery.min.js"></script> <script> jQuery(document).ready(function($){ setInterval(function(){ $('.gallery-reel-control-btn[data-next]').click() },3500); }) </script> Thanks! Beyondspace 1
tuanphan Posted February 4 Posted February 4 Suppose your site is callumt.squarespace.com You can access this url: callumt.squarespace.com/config/safe then you can edit everything easier Beyondspace 1 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!)
Beyondspace Posted March 15 Posted March 15 (edited) On 2/2/2024 at 10:59 PM, CallumT said: Hello, I have a gallery reel which I'd like to auto-scroll. I currently have a script that does work, however, it makes me unable to edit the site once its enabled. Is there any way around that? Here is my script: <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.7.0/jquery.min.js"></script> <script> jQuery(document).ready(function($){ setInterval(function(){ $('.gallery-reel-control-btn[data-next]').click() },3500); }) </script> Thanks! Updated script to use plain Javascript and stops if it is in edit mode <script> if (window.self === window.top) { document.addEventListener("DOMContentLoaded", function() { setTimeout(function() { const nextButton = document.querySelector('.gallery-reel-control-btn[data-next]'); if (nextButton) { nextButton.click(); } }, 3500); }); } </script> Edited March 15 by Beyondspace BeyondSpace - Squarespace Website Developer 🖼️ Lightbox Studio (Enable Pinch/Zoom on lightbox - PDF Lightbox popup - ...) </> 🗓️ Delivery Date Picker (Date picker form field) Gallery block 7.1 workaround </> No-code customisations for Squarespace
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment