Skip to main content

Image comparison

A before and after slider: two images stacked, with a handle that reveals one over the other. Use it for renovations, retouching, product finishes, or any change you want visitors to see side by side.

See it live

The color and the black and white photo of Guatapé split by the draggable handle Live demo on fancybricks.co: drag the handle, or switch the behavior between Drag, Follow the mouse and Follow and return to center.

Add it​

  1. In Bricks › Fancy Bricks, turn on Image Comparison.
  2. In the builder, open the elements panel and add Fancy Image Comparison (category fancy-bricks). It isn't nestable.
  3. Pick Image 1 and Image 2.

Settings​

Fancy Image Comparison in the Bricks panel, three views: Image 1 and Image 2, the behavior switches, and the handle settings The real Bricks panel, set like the demo. From left to right: the two images, Follow Mouse / Ring animation / Return center, and the handle with Aspect Ratio Type.

All the settings are in the Content tab.

Images and behavior​

ControlWhat it doesDefault
Image 1The first image. Accepts dynamic data.—
Image 2The second image, revealed by the handle. Accepts dynamic data.—
Follow MouseOn, the handle follows the mouse. Off, visitors drag it.On
Return centerSends the handle back to the center when the mouse leaves.On
Ring animationAn animated ring around the handle.On
Ring colorThe ring's color. Shows when Ring animation is on.—

Size​

ControlWhat it doesDefault
Aspect Ratio Type16:9 (Widescreen), 4:3 (Standard), 1:1 (Square), 21:9 (Ultrawide), 9:16 (Vertical) or Custom.16:9
Custom Aspect RatioWith Custom, type the ratio as width / height, for example 4 / 3.—

Handle​

ControlWhat it doesDefault
IconThe icon inside the handle.A split arrow
Icon sizeIcon size. Only for font icons, not SVG.16px
Icon colorIcon color. Only for font icons, not SVG.—
Divider ColorThe color of the line between the two images.—
Circle BackgroundThe handle's background.—
Circle Background on FocusThe handle's background when it has keyboard focus.—
Circle borderThe handle's border.—
Circle sizeThe handle's size.35px

Tips​

  • Query loops and product pages. Set both images from dynamic data and the slider repeats per post: one slider per project in a portfolio loop, or the product with and without its finish on a product page. For example, with two ACF image fields named before_photo and after_photo, use these tags in Image 1 and Image 2:

    {acf_before_photo}
    {acf_after_photo}
  • Keyboard. The handle is a range control, so it can be focused and moved with the arrow keys.