Jump to content

Auto-Scroll Timing for Summary block

Recommended Posts

Hello -

I used the following code found on another thread to auto-scroll my testimonials (I used a carousel summary block). It works great. However, I'm hoping someone can help me figure out how to slow it down. It's currently scrolling every 3 seconds. FYI - I'm new to using code. 🙂 

Thanks a ton!

<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
  • 5 months later...

oop, figured it out

<script>
   if( /Android|webOS|iPhone|iPad|iPod|BlackBerry/i.test(navigator.userAgent) ) {
    Y.on('domready', function () {
       var galleries = Y.Squarespace.GalleryManager.getGalleries();
       for( i = 0; i<galleries.length; i++){
           galleries[i].setAttrs({"autoplay":true})
       }
   });
}
</script>

 

Edited by LostBoy
Link to comment
  • 1 year later...
On 4/16/2020 at 8:14 PM, SaraB said:

Hello -

I used the following code found on another thread to auto-scroll my testimonials (I used a carousel summary block). It works great. However, I'm hoping someone can help me figure out how to slow it down. It's currently scrolling every 3 seconds. FYI - I'm new to using code. 🙂 

Thanks a ton!

<script>
   Y.on('domready', function () {
       var galleries = Y.Squarespace.GalleryManager.getGalleries();
       for( i = 0; i<galleries.length; i++){
           galleries[i].setAttrs({"autoplay":true})
       }
   });
</script>

try

<script>
    Y.on('domready', function () {
        var galleries = Y.Squarespace.GalleryManager.getGalleries();
        for( i = 0; i < galleries.length; i++){
            galleries[i].setAttrs({
              "autoplay": true,
              "autoplayOptions": {
          "timeout":10000,
              }
            })
        }
    });
</script>

Change the timeout value to see if it for your template

Greeting, it's BeyondSpace, I am Squarespace dev focus on provide solutions to enhance feature that squarespace.com can't provide.
Feel free to check my current Squarespace Plugins Developement: Enable Pinch/Zoom on lightbox, Delivery Date Picker, Keyword Highlighter
If you find my answer fit your need, 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.