How to Add a Before and After Slider to Wix (Step-by-Step, No App Required)
Complete step-by-step tutorial to embed a responsive, 60fps before-and-after image comparison slider into your Wix website using free HTML embedding without paying for expensive App Market plugins.
Whether you are an interior designer showcasing home renovations, a photographer displaying color grading, or a medical clinic demonstrating patient transformations, an interactive before-and-after slider is the most persuasive visual tool on your Wix website.
Rather than forcing visitors to glance back and forth between two separate static images, an interactive slider allows prospective clients to slide a divider back and forth with their thumb or mouse, revealing changes with sub-pixel alignment.
While the Wix App Market features third-party widgets like Common Ninja or Before & After Slider, most of them charge $4 to $8 per month, impose arbitrary pageview caps, or load heavy third-party tracking scripts that slow down your Wix mobile page speed.
In this tutorial, you will learn how to embed a lightweight, hardware-accelerated 60 FPS before-and-after comparison slider into your Wix website in less than 3 minutes—completely free and with zero monthly view limits.
Performance Benchmark: Native Code vs Wix App Market Widgets
To test real-world impact on Google Core Web Vitals, our engineering lab created identical test pages on Wix Studio and ran Google PageSpeed Insights and WebPageTest:
| Metric | DiffSlider HTML Embed | Typical Wix App Market Plugin | Impact on SEO & UX |
|---|---|---|---|
| Monthly Cost | $0 / Free Forever | $4.99 – $9.99 / month | Save $60–$120/yr per site |
| Additional JS Payload | < 18 KB (gzipped) | 340 KB – 580 KB | 95% reduction in script bloat |
| LCP (Largest Contentful Paint) | 1.1s (Passes Green) | 2.8s (Needs Improvement) | Better Google ranking factor |
| CLS (Cumulative Layout Shift) | 0.000 (Rock solid) | 0.142 (Layout jumps on load) | Prevents accidental misclicks |
| Monthly View Limit | Unlimited | 500 – 2,500 views / month | No broken widgets on traffic spikes |
| Zoom Inspection | Up to 1600% Sub-Pixel | None (Static drag only) | Instant credibility on fine details |
Step 1: Generate Your Comparison on DiffSlider
- Open the DiffSlider Comparison Generator.
- Drag and drop your Before and After photos into the upload box.
- Add descriptive labels (for example, “Before Treatment” and “8 Weeks Post”).
- Select your preferred initial view mode (Slider, Side-by-Side, Toggle, or Difference view).
- Click Publish to generate your private comparison.
- In the export panel, select the Wix tab (or copy the Embed iframe code).
The generated snippet looks like this:
<!-- Wix: Add Elements (+) → Embed Code → Embed HTML / iFrame -->
<div style="width:100%;max-width:960px;margin:0 auto">
<iframe
src="https://diffslider.app/embed/YOUR_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 an HTML Embed Element in the Wix Editor
- Open your Wix Studio or Wix Classic Editor.
- Navigate to the page and section where you want the slider to appear.
- In the left-hand toolbar, click the + (Add Elements) button.
- Select Embed Code > Popular Embeds > Embed HTML (or HTML iframe in older editor versions).
- A blank gray embed box will appear on your canvas.
Step 3: Paste Your DiffSlider Embed Code
- Click on the gray HTML element you just added, then click the Enter Code (or Settings) button directly above it.
- Ensure the Code radio button is selected (rather than Website Address).
- In the text area labeled Add your code here (HTTPS only), paste the DiffSlider iframe code snippet you copied in Step 1.
- Click Apply or Update.
- Your interactive before-and-after slider will immediately render inside the Wix canvas!
Step 4: Sizing & Mobile Touch Optimization in Wix
Wix uses separate layouts for desktop and mobile viewports. Follow these two adjustments to prevent container clipping:
1. Match Container Height to Image Ratio
If your images are 16:9 landscape (e.g., 1920x1080), and your Wix HTML element width is set to 800px, adjust the element’s height handle to 480px to 520px. This leaves comfortable space for the slider and toolbar without spawning an inner scrollbar.
2. Configure the Mobile Layout
- Click the Mobile icon in the top navigation bar of the Wix Editor.
- Find the HTML iframe box. Drag the corner handles so it spans 95% to 100% of the mobile screen width.
- Preview the live site on your smartphone: swipe across the image to experience the silky 60fps GPU-accelerated touch glide.
Troubleshooting Common Wix Embedding Issues
Issue 1: Double Scrollbars inside the Wix Embed
- Root Cause: The Wix HTML element’s height is set smaller than the iframe content.
- Solution: Select the embed box in Wix and pull down the bottom handle by 30–50 pixels until the scrollbar disappears.
Issue 2: Toolbars Overlapping Section Backgrounds
- Solution: In the embed URL, append
&toolbar=0(e.g.,https://diffslider.app/embed/ID?toolbar=0) to eliminate all top controls for an ultra-clean, full-bleed presentation.
Frequently Asked Questions
Does this require a paid Wix App Market subscription?
No. Wix allows all plans (including free and premium) to use the native Embed HTML element without purchasing any third-party app store add-ons.
Will the slider slow down my Wix page loading speed?
No. DiffSlider iframes are lightweight and include loading="lazy", meaning the viewer is only downloaded when a visitor scrolls near the element.
Does it support pinch-to-zoom on mobile?
Yes. DiffSlider provides hardware-accelerated 60 FPS touch gestures, allowing smartphone visitors to drag the slider divider smoothly and double-tap or pinch to inspect fine details up to 1600%.
Frontend Performance & CMS Architect · Verified on live instances (Tested on Wix Studio (Editor X) & Classic Wix Editor).