Linux 软件免费装
Banner图

Image Comparison Block – Before After Image Slider

开发者 binsaifullah
更新时间 2026年11月9日 16:28
PHP版本: 7.4 及以上
WordPress版本: 7.1
版权: GPLv2 or later
版权网址: 版权信息

标签

before after image comparison image compare comparison slider photo comparison

下载

1.6.0 1.6.1 1.5.0 1.6.2 1.7.1 1.0.0 1.7.0

详情介绍:

Image Comparison Block is a lightweight before and after image comparison slider for the WordPress block editor (Gutenberg). Place two images on top of each other and let visitors drag, click or swipe the handle to reveal the difference. It is built with native block editor components, has no jQuery or third-party JavaScript libraries, and loads its tiny front-end script only on pages that actually use the block, so it will not slow down the rest of your site. See Live Demos [youtube https://www.youtube.com/watch?v=OylHrkczwK4] Perfect For A before/after slider is the clearest way to show a transformation. Use it for: Key Features How to Use
  1. Add the Image Compare block from the Media category, or type /image compare in the editor.
  2. Choose a before image and an after image from the Media Library.
  3. Pick the orientation, starting position, labels and styles from the block sidebar.
  4. Publish. Your before/after slider is live.
Why Image Comparison Block? Many image comparison plugins depend on jQuery, page builders or heavy sliders. Image Comparison Block is a single, focused block that does one thing well: a fast, accessible and good-looking before and after image slider that fits right into the block editor.

安装:

  1. Upload the plugin files to the /wp-content/plugins/image-compare-block directory, or install the plugin through the WordPress plugins screen directly.
  2. Activate the plugin through the "Plugins" screen in WordPress.
  3. Open the block editor and add the "Image Compare" block from the Media category, or type /image compare.
  4. Select a before image and an after image.

屏幕截图:

  • The Settings tab: choose the images and alt text, orientation, starting position and hover mode.
  • The Styles tab: aspect ratio, border, handle style and colors, and label styles.

升级注意事项:

1.7.1 Plugin renamed to Image Comparison Block. No changes to your existing blocks. 1.7.0 Major update with a rebuilt, accessible slider and new settings. Existing blocks are migrated automatically. Requires WordPress 6.6 and PHP 7.4.

常见问题:

How do I add a before and after image slider in WordPress?

Install and activate the plugin, open a post or page in the block editor, add the "Image Compare" block and choose your before and after images. That's it.

Does it work with my theme?

Yes. It works with block themes and classic themes, and in posts, pages, custom post types, widgets and Site Editor templates wherever the block editor is available.

Do I need a page builder?

No. It is a native Gutenberg block. No page builder is required.

Is it responsive and mobile friendly?

Yes. The slider scales with its container, serves responsive images from the Media Library, and supports swiping on touch devices while vertical page scrolling still works.

Can I make a vertical (top/bottom) comparison?

Yes. Turn on vertical mode in the block settings to compare images from top to bottom.

Can I add "Before" and "After" labels?

Yes. Enable labels, change their text, and style their position, colors and font size. Labels can be always visible or shown only on hover.

Will it slow down my website?

No. The block has no jQuery or external dependencies, and its small script and styles load only on pages that contain the block.

Is it accessible?

Yes. The slider handle can be focused with the keyboard and moved with the arrow keys, Page Up/Down, Home and End. It is exposed to assistive technology as a slider with its current value, and you can set alt text for both images.

Can I use more than one comparison slider on a page?

Yes. Add as many Image Compare blocks as you like.

Should both images be the same size?

For the best result, use two images with the same dimensions and framing. You can also set an aspect ratio on the block to crop both images evenly.

Will my existing blocks keep working after updating?

Yes. Blocks created with older versions are upgraded automatically. On the front end they use the new slider straight away, and the next time you open the post in the editor they are migrated with no validation errors.

Have you used any block builder?

No, it is built with native block editor components only.

更新日志:

1.7.1 1.7.0 1.6.2 1.6.1 1.6.0 1.5.0 1.0.0