Jump to content

Auto Scroll All Summary Carousels on the page

Recommended Posts

Hello, I have multiple summary carousel's near the end of my home page. 

I'd like for all of them to autoscroll. Found this great code by Rebecca Grace Designs that scrolls the first summary but not the rest of them. 

What can I add to apply the code to all of the carousels?

Can I set this code for specific carousels by calling out the block ID, if so where would that go? 

 

<script>
window.onload = function() {
  var nextArrow = document.querySelector(".summary-carousel-pager-next");
  function clickNext() {
    nextArrow.click();
  }
  setInterval(clickNext, 10000);
};
</script>

 

Link to comment
3 hours ago, apt113 said:

Hello, I have multiple summary carousel's near the end of my home page. 

I'd like for all of them to autoscroll. Found this great code by Rebecca Grace Designs that scrolls the first summary but not the rest of them. 

What can I add to apply the code to all of the carousels?

Can I set this code for specific carousels by calling out the block ID, if so where would that go? 

 

<script>
window.onload = function() {
  var nextArrow = document.querySelector(".summary-carousel-pager-next");
  function clickNext() {
    nextArrow.click();
  }
  setInterval(clickNext, 10000);
};
</script>

 

Have you tried the solution in this post?

If it does not work, share your URL so we can take a look

Edited by Beyondspace

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
7 hours ago, Beyondspace said:

Have you tried the solution in this post?

If it does not work, share your URL so we can take a look

Thanks, I Did see that solution but that's for galleries. I have multiple summary - carousels with my different blog posts and things to scroll. 

Here's my site to take a look https://apt113.com

On the home page at the bottom I'd like all of the different summary carousels to auto scroll. 

 

Edited by apt113
Link to comment
21 hours ago, apt113 said:

Would querySelectorAll just replace querySelector on this line? 

 var nextArrow = document.querySelector(".summary-carousel-pager-next");

yep.

It returns an array, so you might need to adjust the function 

 

Link to comment
On 3/16/2023 at 7:19 AM, oMcLeod said:

yep.

It returns an array, so you might need to adjust the function 

 

Awesome, I'll try that now. Could you give me some insight on how to adjust the function above to take an array using queryselectorAll.

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.