Jump to content

Auto Scroll Carousel Block Squarespace 7.1

Go to solution Solved by Rebecca_Grace_Designs,

Recommended Posts

On 9/18/2020 at 2:51 PM, Rebecca_Grace_Designs said:

**UPDATED***

For anyone still looking, I found a workaround for autoplaying a Summary Carousel Block. It autoclicks the next button every three seconds. 

Inject this is Settings > Advanced > Code Injection > Footer

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


I updated this code to remove the use of JQuery (for page speed reasons) as well as to help with the refresh timeframe.

@Rebecca_Grace_Designs Thank you so much for sharing this. It was working well for me on this website, now suddenly the bottom carousel (under Vintage Lighters) will not work, yet the top one on the same page is still working. I have checked the code, removed, added back again, etc. and still it won't budge. Any idea how to correct the issue? 

Link to comment
3 hours ago, tiffanydavidson said:

Any idea how to correct the issue?

The code you are using was only designed to work for one summary block. To work with multiple blocks it would need to be enhanced.

You should also be aware of the issue that @Nick_SquareKicker brought up.

I also noted that the code runs right away and if your summary is a ways down the page, the code has already run through the groups of elements before the summary even gets into view.

Find my contributions useful? Please like, upvote, mark my answer as the best ( solution ), and see my profile. Thanks for your support! I am a Squarespace ( and other technological things ) consultant open for new projects.

Link to comment
9 minutes ago, creedon said:

The code you are using was only designed to work for one summary block. To work with multiple blocks it would need to be enhanced.

You should also be aware of the issue that @Nick_SquareKicker brought up.

I also noted that the code runs right away and if your summary is a ways down the page, the code has already run through the groups of elements before the summary even gets into view.

@creedon Thank you for this very helpful feedback. Is there a way to make the original code work for all summary block carousels on the site *and* to have it loop once ran through? Happy to pay for anyones time who can help with this issue.

Link to comment
  • 2 weeks later...
  • 3 months later...
On 12/14/2023 at 5:13 PM, NicolaH said:

Hi, am hoping this thread can still be added to....?

I'm looking for the same autoplay and loop but to be able to apply to an intro block on the home page on this website

https://badger-oval-74a3.squarespace.com/home

And only want it on the first intro block and nothing else on page. How is it best to do this?

thanks

What is password?

image.png.26206db6773f4c9e689e3bb74abbedf1.png

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

Hi @tuanphan thanks for your message. Have replied via email 

On 4/14/2020 at 8:54 PM, scipioni_central said:
<script>
   Y.on('domready', function () {
       var galleries = Y.Squarespace.GalleryManager.getGalleries();
       for( i = 0; i<galleries.length; i++){
           galleries[i].setAttrs({"autoplay":true})
       }
   });
</script>

 

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.