How to Add a Before and After Slider to Squarespace (Free, No Plugin)
Step-by-step tutorial on how to embed a responsive before-and-after image slider in Squarespace 7.1 and 7.0 using free Code blocks without paying for expensive third-party plugins.
Squarespace is the premier website builder for visual storytellers: wedding photographers, interior designers, architects, hair stylists, cosmetic injectors, and visual artists.
Yet, despite Squarespace’s sleek templates and Fluid Engine grid, Squarespace has no native before-and-after image slider block.
If you search the web or community forums for a Squarespace comparison slider, you typically encounter:
- Paid third-party plugins (like Ghost Plugins or SQSP Themes) charging $20 to $45 for single-site licenses.
- Clunky JavaScript code injections that break every time Squarespace updates its layout engine.
- Monthly subscription widgets that slap ugly third-party watermarks on your professional portfolio.
In this step-by-step tutorial, you’ll learn how to add a 100% responsive, high-definition 60 FPS before-and-after slider to any Squarespace 7.1 or 7.0 website in less than 2 minutes—completely free, with zero plugins and no monthly fees.
Technical Benchmark: DiffSlider Code Block vs Paid Squarespace Plugins
Our design studio tested both options on an active Squarespace 7.1 portfolio template:
| Feature | DiffSlider Free Embed | Ghost Plugins / SQSP Themes | Custom JS Code Injection |
|---|---|---|---|
| Cost | $0 (Free Forever) | $29 – $49 one-time | Free (High dev time) |
| Squarespace Fluid Engine Support | Full Grid Drag & Drop | Requires custom CSS tweaks | Often breaks on layout changes |
| Mobile Core Web Vitals | LCP < 1.2s (Zero impact) | Adds 220KB+ external JS | Potential CLS layout shifts |
| Pinch & Double-Tap Zoom | Up to 1600% Sub-Pixel | None | None |
| Maintenance Burden | Zero (Asynchronous iframe) | Manual CSS updates | High (Fragile code dependencies) |
Step 1: Create Your Comparison on DiffSlider
- Go to the DiffSlider Comparison Tool.
- Drag and drop your Before and After images into the canvas.
- Label each photo (for example, Raw Photo vs Color Graded or Before Renovation vs Finished Staging).
- Click Publish to generate your embed code.
- In the export panel, switch to the Squarespace tab and copy the snippet:
<!-- Squarespace: Add Block (+) → Code Block (Mode: HTML) -->
<div class="sqs-diffslider-wrapper" style="width:100%;max-width:1000px;margin:0 auto">
<iframe
src="https://diffslider.app/embed/YOUR_COMPARISON_ID?toolbar=1"
title="Before and after comparison"
style="width:100%;aspect-ratio:16/9;border:0;border-radius:12px;display:block"
loading="lazy"
allowfullscreen>
</iframe>
<p style="margin:6px 0 0;font-size:12px;color:#888;text-align:center">
Before & after slider by <a href="https://diffslider.app" target="_blank" rel="noopener">DiffSlider</a>
</p>
</div>
Step 2: Add a Code Block in Squarespace 7.1 (Fluid Engine)
- Log in to your Squarespace dashboard and open the page where you want the slider to appear.
- Click Edit in the top-left corner of the page preview.
- Hover over the section where you want to place the comparison and click Add Block.
- In the block menu, select Code (denoted by
</>). - Double-click the new Code Block or click the pencil icon to open its settings:
- Set Mode to HTML.
- Make sure Display Source is turned OFF.
- Delete the placeholder text (
<p>Hello World!</p>) and paste your DiffSlider embed code. - Click outside the code editor box.
- Using Squarespace’s Fluid Engine, drag the blue bounding box handles to resize the width and height of the block to fill your desired grid columns (we recommend 8 to 12 columns for full-width impact).
- Click Save in the top-left corner.
Step 3: Optimizing for Squarespace Mobile View
Squarespace Fluid Engine handles mobile and desktop viewports independently:
- Click the Mobile view icon in the top-right corner of the Squarespace editor.
- Verify that the Code Block container spans the full width of the mobile viewport. If it appears narrow, drag the corner blue handles across all 8 mobile grid columns.
- Save changes and open your live URL on your smartphone: swipe across the image to test the 60fps tactile drag.
Troubleshooting Common Squarespace Issues
1. Code Block Shows Raw HTML Instead of the Slider
- Fix: In the Code Block settings, ensure Display Source is toggled OFF.
2. Excessive Empty Space Below the Slider
- Fix: In Squarespace Fluid Engine, the bounding box determines row height. Click the Code Block and pull the bottom blue handle upward until it sits flush against the bottom of the slider.
Pro Customization: Matching Your Squarespace Aesthetic
DiffSlider allows you to fine-tune embed styling to match your brand palette:
- Hide Top Toolbar: Append
&toolbar=0to the embed URL for an ultra-clean, minimalist presentation. - Custom Accent Color: Match your Squarespace primary color by adding
&color=0ea5e9(replace with your hex code). - Auto-Sweep on Scroll: Add
&autoplay=1so when a client scrolls past the slider, the handle automatically glides back and forth once to invite interaction. - 100% White-Label: If you manage high-ticket commercial clients, upgrade to DiffSlider Pro to remove all branding badges and attribution links for a flawless native luxury look.
Visual UX & Digital Portfolio Specialist · Verified on live instances (Tested on Squarespace 7.1 Fluid Engine & 7.0 Classic).