Jump to content

Can't get gallery reel to auto scroll

Go to solution Solved by Beyondspace,

Recommended Posts

Site URL: https://www.qutefs.com.au/home-test

Hi there,

We are trying to launch a new page with our sponsors logos on it and I can't for the life of me work out how to get the banners to auto scroll. On our test home page I have tried to use code form this forum page but there's obviously no carousel available anymore. The only way to get it to auto play is using the simple slideshow format but that only shows one image at a time and is too tall for me to even consider it. We're trying to keep it pretty short so it doesn't take up the whole page. Any help or ideas for this would be much appreciated. Home Test Flight — QUTEFS - QUT Economics and Finance Society

 

Link to comment
  • Solution
5 hours ago, tomtho said:

Site URL: https://www.qutefs.com.au/home-test

Hi there,

We are trying to launch a new page with our sponsors logos on it and I can't for the life of me work out how to get the banners to auto scroll. On our test home page I have tried to use code form this forum page but there's obviously no carousel available anymore. The only way to get it to auto play is using the simple slideshow format but that only shows one image at a time and is too tall for me to even consider it. We're trying to keep it pretty short so it doesn't take up the whole page. Any help or ideas for this would be much appreciated. Home Test Flight — QUTEFS - QUT Economics and Finance Society

 

I gave the solution in the following post: 

For you case, we need change a little bit in selecting the next button (Currently your page has 2 next button, one in carousel, one in lightbox). Try adding to Home > Settings > Advanced > Code Injection, choose footer

<script>
  (function docReady(fn) {
    // see if DOM is already available
    if (document.readyState === "complete" || document.readyState === "interactive") {
      // call on next available tick
      setTimeout(fn, 1);
    } else {
      document.addEventListener("DOMContentLoaded", fn);
    }
  })(() => {
    if (window.location == window.parent.location) {
      const reelControls = document.querySelectorAll('.gallery-reel-control-btn[aria-label*="Next"]');
      reelControls.forEach(reelControl => {
        (function reelTimer() {
          setTimeout(() => {
            reelControl.click();
            reelTimer();
          }, 2000); // change this value to change the speed
        })();
      })
    }
  });

</script>

Let me know how it works on your site

Edited by bangank36

BeyondSpace - Squarespace Website Developer

🖼️ Lightbox Studio (Enable Pinch/Zoom on lightbox)
🗓️ Delivery Date Picker (Squarespace Date picker form field)
💫 Gallery block 7.1 workaround
🥳 Sparkplugin Customisations Browsers (Browse +100 Spark plugin customisations)
🥳 Elfsight Template Browsers (Browse +1000 Elfsight widget Templates)

If you find my answer useful, let's leave a like or upvote so others with the same issue can find their solution. Thank you!

 

Link to comment

You're an absolute legend! Thanks so much it works perfectly. 

One follow up question. Since this is our test home page that we'll eventually swap with our current one, will I have to change anything if its slug is going from /home-test to /home?

Link to comment
12 minutes ago, tomtho said:

You're an absolute legend! Thanks so much it works perfectly. 

One follow up question. Since this is our test home page that we'll eventually swap with our current one, will I have to change anything if its slug is going from /home-test to /home?

No, my code apply for the general class, not target to a specific block, so you can check it in you go-live page

Edited by bangank36

BeyondSpace - Squarespace Website Developer

🖼️ Lightbox Studio (Enable Pinch/Zoom on lightbox)
🗓️ Delivery Date Picker (Squarespace Date picker form field)
💫 Gallery block 7.1 workaround
🥳 Sparkplugin Customisations Browsers (Browse +100 Spark plugin customisations)
🥳 Elfsight Template Browsers (Browse +1000 Elfsight widget Templates)

If you find my answer useful, let's leave a like or upvote so others with the same issue can find their solution. Thank you!

 

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

×
×
  • Create New...

Squarespace Webinars

Free online sessions where you’ll learn the basics and refine your Squarespace skills.

Hire a Designer

Stand out online with the help of an experienced designer or developer.