Docs

Before / After

Compare two images with a draggable divider.

On this page

The Before / After widget lays two images on top of each other with a divider that visitors drag to compare them. It is ideal for renovations, restorations, retouching or any change you want to show. The divider works with the mouse, touch and the keyboard.

A before and after comparison with a draggable round handle in the middle: an empty grey room on the left labelled Before and a furnished room on the right labelled After
The divider starts in the middle; visitors drag it to compare.

Add a before / after comparison

  1. Insert it

    Open Insert in the left panel, find Before / After under Media (or type before in Search widgets) and click it or drag it onto the canvas.

  2. Choose the two images

    Pick the Before image and the After image in Content → Images. Use two photos with the same size and framing.

  3. Label and position

    Change the Before label and After label if you like, choose when to Show labels, and set the Initial position of the divider.

  4. Pick the direction

    Keep Horizontal to drag left and right, or choose Vertical to drag up and down.

Settings

Settings marked Per device can differ on desktop, tablet and mobile (see Responsive editing). Both images support dynamic tags (see Dynamic tags).

Content tab

Images
SettingWhat it does
Before imageThe “before” image, shown on the left (or top). Supports dynamic tags.
After imageThe “after” image, shown on the right (or bottom). Use images with the same size and framing. Supports dynamic tags.
ResolutionThe image size WordPress serves. Smaller files load faster; pick one at least as wide as the image is shown. Default: Large.
Before labelLabel on the before image.
After labelLabel on the after image.
Show labelsShows the labels always, only when the pointer is over the images, or never. Options: Always, On hover, Never. Default: Always.
Labels positionWhere the labels sit along the edge. Options: Start, Center, End. Default: Start. Shown when Show labels is set.
OrientationHorizontal drags the divider left and right; Vertical drags it up and down. Options: Horizontal, Vertical. Default: Horizontal.
Initial positionWhere the divider starts, in %. Default: 50%.
Follow the mouseThe divider follows the pointer without clicking.
Handle iconIcon on the divider handle.
Aspect ratioCrops both images to a fixed shape. Original keeps the images’ own shape. Per device.

Design tab

Image
SettingWhat it does
Border radiusRounds the corners of the images. Per device.
BorderBorder around the images.
ShadowShadow of the images.
Handle
SettingWhat it does
Line colorColor of the divider line.
Line widthThickness of the divider line.
Handle sizeSize of the handle. Per device.
Handle backgroundBackground color of the handle.
Handle icon colorColor of the handle icon.
Handle radiusRounds the handle; 50% makes it a circle. Per device.
Handle borderBorder of the handle.
Handle shadowShadow of the handle.
Labels

This section shows when Show labels is set.

SettingWhat it does
TypographyText style or font, size, weight and spacing of the labels.
ColorText color of the labels.
BackgroundBackground color of the labels.
PaddingSpace inside the labels. Per device.
Border radiusRounds the corners of the labels. Per device.
Distance from edgeDistance of the labels from the edge of the images.
Shared Design sections

Every element also has these sections at the end of the Design tab.

SectionWhat it does
Spacing & positionMargin, padding, width, alignment in its container, order, position (relative, absolute, fixed), offsets, z-index and global classes. See Spacing, size & position.
Background & borderBackground, border, border radius, box shadow, overflow and opacity of the whole element. See Colors & backgrounds and Borders & shadows.
MaskCrops the element to a shape (circle, arch, blob, star…) or your own SVG or PNG. See Shape dividers & masks.

Behaviour tab

Behaviour sections

The Behaviour tab is the same for every element.

SectionWhat it does
Anchor & classesAn Anchor ID for #links and your own CSS classes.
AnimationsEntrance, scroll, hover and loop animations from presets or your own timeline. See Motion & effects.
Motion & effectsA simple entrance animation, transforms (also on hover), CSS and backdrop filters, and sticky positioning.
Scroll & mouse effectsMovement, rotation, scale, fade and blur while the page scrolls, and pointer effects (follow the pointer, 3D tilt).
VisibilityHide the element on desktop, tablet or mobile, or in dark or light mode. See Visibility.
ConditionsShow the element only when rules match, such as logged-in visitors, a date range or a URL parameter. See Display conditions.
InteractionsShow, hide or change other elements when this one is clicked, hovered or scrolled into view. See Interactions.
AttributesCustom HTML attributes for this element. See Anchor, classes & attributes.

Tips

  • Match the photos. Shoot both images from the same spot, or crop them to the same size; otherwise the comparison jumps. Aspect ratio crops both to the same shape.
  • Keyboard and screen readers. The divider is also a slider that keyboard users move with the arrow keys; the labels name the two images.
  • Follow the mouse. Follow the mouse moves the divider without clicking, which suits large desktop layouts; on touch screens visitors still drag.