Before And After Image Slider Plugin

Installation Steps

Step 1 (a): CSS code injection footer

Place the following CSS code in the Code Injection section.

Pages > Custom Code > Code Injection > Header

Step 1 (b): JS code injection footer

Place the following javascript code in the Code Injection section.

Pages > Custom Code > Code Injection > Footer

How to Add the Before and After Image Slider

  1. Upload the slider images to your Squarespace site.

  2. Open the page where you want the Before and After Slider to appear and add a code block.

  3. Generate the HTML code for the Before and After Image Slider.

  4. Copy and paste the HTML code into the code block.

  5. Customise the Before and After Image Slider as needed.

  6. Copy and paste the CSS code into the Advanced section of the page where you want the slider to appear.

  7. Finally, don’t forget to save the page.


Step 2: Upload slider images



Step 3: HTML code generation for ‘Before And After’ image slider

  1. Open the page where you want the before and after image slider to appear.

  2. Enter the sentence before the typing carousel effect.

  3. Create a code block on the page and copy the code below.

URL for the before image

URL for the After image

Label for the before image

Label for the After image

<div class="custom-image-slider">
<img class="slider-before" src="/image-before.jpg" alt="Before" data-label-before="Before">
<img class="slider-after" src="/image-after.jpg" alt="After" data-label-after="After">
<div class="slider-handle" tabindex="0"></div>
</div>

Step 4: ‘Before And After’ image slider customisation

Slider Label Position

Slider Handle Colour

Slider Border Radius

Slider Border Width

Slider Border Colour

Slider Border BoxShadow

Slider Border BoxShadow Colour

Label BoxShadow Colour

Label Colour

Label Padding


Step 5: Copy ‘Before And After’ image slider CSS code

  1. Copy the generated CSS code for your ‘before and after’ image slider.

  2. Place the following code in the advanced section of the page the ‘before and after’ image slider is to appear.

    • Click Pages in the left-hand menu

    • Locate the page you want to edit (Main Navigation or Not Linked)

    • Hover over the page name

    • Click the ⚙️ gear icon (Page Settings)

    • In the Page Settings window, click Advanced

<!--------------------------------------------------------->
<!-- Before and After Slider © IGH Creations  -->
<!--------------------------------------------------------->
<style>
:root { /* ===== Slider Options ===== */
--slider-position: Top; /* Label position on slider: 'top' or 'bottom' */
/* ===== Slider Handle Styling ===== */
--pcSlider-handle-bkg-color: #ffffff; /* Color of the vertical handle */

/* ===== Slider Container Styling ===== */
--pcBorder-radius: #ffffff; /* Rounded corners of the slider */
--pcBorder-size: 1px; /* Border thickness */
--pcBorder-colour: #000000; /* Border color */
--pcBoxShadow: 0 8px 24px; /* Shadow offset and blur */
--pcBoxShadow-colour: rgba(169, 134, 44, 0.9); /* Shadow color */

/* ===== Label Styling ===== */
--pcLabel-bkg-color: rgba(0,0,0,0.5); /* Background color of labels */
--pcLabel-color: #ffffff; /* Text color of labels */
--pcLabel-font-size: var(--normal-text-size-value); /* Font size of labels */
--pcLabel-padding: 4px 10px; /* Padding inside labels */
}
</style>
<!-- Before and After Slider © IGH Creations    -->