How to Create an Auto-Scroll YouTube Video Carousel on Squarespace (2025 Guide)
Want to showcase your YouTube videos in an elegant, interactive carousel on your Squarespace website? This step-by-step guide will show you how to create a professional-looking video carousel with autoplay functionality that works seamlessly on both desktop and mobile devices.
Prerequisites
Before we begin, make sure you have:
A Squarespace website (version 7.1)
YouTube video links ready to embed
Access to your Squarespace site's code injection settings
Basic understanding of copying and pasting code
Step-by-Step Implementation
Step 1:
Create a new page or edit an existing one
Add a Code Block element where you want the carousel to appear
Step 2: Insert HTML structure:
Step 3: Prepare Your Video IDs
Before we dive into the code, you'll need to gather your YouTube video IDs. Here's how to find them:
Go to your YouTube video
Look at the URL:
https://www.youtube.com/watch?v=
XXXXXXXXX
The part after
v=
is your video IDCopy these IDs - you'll need them in the next step
For example, if your YouTube URL is https://www.youtube.com/watch?v=8ORwAv5vlVo
, then 8ORwAv5vlVo
is your video ID.
Important Notes:
Keep the
?enablejsapi=1
at the end of each video URLDon't remove any of the navigation divs
Make sure each video is inside its own
swiper-slide
divThe code works with any number of videos
Common Mistakes to Avoid:
Don't forget to wrap each iframe in a
swiper-slide
divDon't remove the
enablejsapi=1
parameterMake sure your video IDs are correct
Keep all the navigation elements even if you don't plan to use them
Now that you have your HTML structure ready, you'll need to add the required CSS and JavaScript code to make it functional. Would you like me to explain those parts next?
Step 4: Prepare Your Code Injection
First, we need to add required libraries to your Squarespace site's header.
Add this code to Settings > Advanced > Code Injection > Header
In the Header section, add the following code:
Step 5: Initialize the Carousel
Add this JavaScript code to your Footer Code Injection:
Step 4: Style Your Carousel
Add these CSS rules to Design > Custom CSS:
Mobile Optimization
Add these styles to ensure your carousel works perfectly on mobile devices:
Troubleshooting Common Issues
Videos Not Playing
Check if all YouTube IDs are correct
Verify that enablejsapi=1 is included in the iframe URLs
Ensure all code injections are properly saved
Carousel Not Responsive
Verify all CSS is properly added
Check for any conflicting styles
Ensure mobile CSS is included
Navigation Buttons Not Working
Confirm Swiper JS is properly loaded
Check browser console for errors
Verify navigation elements are properly named
Customization Options
You can customize your carousel by adjusting these parameters:
1- Autoplay Speed (javascript)
2- Carousel Height (CSS)
3- Navigation Button Colors (CSS)
Conclusion
You now have a professional-looking, auto-playing YouTube video carousel on your Squarespace website! This feature will help keep your visitors engaged and make your content more accessible. Remember to regularly update your videos and monitor their performance through YouTube Analytics.
[Note: This tutorial is current as of January 2025. While we strive to keep our content up-to-date, Squarespace's interface and features may change.]