Linux 软件免费装
Banner图

VisualCompare – Before & After Slider

开发者 volodymyrdev
更新时间 2026年7月27日 03:00
PHP版本: 7.4 及以上
WordPress版本: 7.0
版权: GPLv2 or later
版权网址: 版权信息

标签

accessibility before after before after slider image comparison comparison slider

下载

1.0.1 1.0.2 1.0.0

详情介绍:

VisualCompare – Before & After Slider helps you show visual changes clearly: renovations, design revisions, retouching, medical or beauty results, product updates, restoration work, and any other before-and-after image comparison. Instead of placing two separate images side by side, you can add an interactive comparison slider that works with mouse, touch, keyboard, responsive images, and a no-JavaScript fallback. The same comparison can be created once, reused across pages, inserted with the WordPress block editor, added in Elementor, or embedded with a shortcode. Why use VisualCompare? Features Common use cases Integrations VisualCompare does not claim official partnership with WordPress or Elementor. Dedicated Bricks and Divi modules are not included in this version, but shortcode embeds can be used in areas where those builders support WordPress shortcodes. Accessibility and performance VisualCompare uses progressive enhancement. The HTML output includes both images first, then the frontend script enhances the comparison into an interactive slider when possible. Keyboard support, range input semantics, visible labels, screen-reader instructions, unique instance IDs, and no-JavaScript fallback behavior are built into the renderer. Frontend CSS and JavaScript are registered globally but enqueued only when the plugin can detect or render a comparison. This keeps pages without before-and-after sliders free from unnecessary VisualCompare assets.

安装:

  1. Upload the visual-compare folder to /wp-content/plugins/.
  2. Activate VisualCompare – Before & After Slider in the WordPress admin.
  3. Open a post or page and add the Visual Comparison block from the block inserter.
  4. Choose the before and after images from the WordPress Media Library.
  5. Optional: create reusable items under Visual Comparisons and insert them with [visual_compare id="123"].
  6. Optional: open Visual Comparisons > Settings to set defaults for new comparisons.
Editors and administrators can create and edit comparisons. Only administrators can change plugin settings and the uninstall cleanup option.

屏幕截图:

  • Elementor Visual Comparison widget with before and after image controls and live page preview.
  • WordPress block editor Visual Comparison block with inline image mode and sidebar controls.
  • Reusable Visual Comparison editor with image controls, labels, orientation, start position, aspect ratio, and live preview.

常见问题:

Does VisualCompare require Elementor?

No. VisualCompare includes a native WordPress block, reusable comparison entries, and shortcode support. The Elementor widget is available only when Elementor is active.

Does VisualCompare support the WordPress block editor?

Yes. Add the Visual Comparison block from the block inserter. The block supports inline comparisons and reusable Visual Comparison items.

Does VisualCompare support Bricks, Divi, or other builders?

This version includes dedicated support for the WordPress block editor and Elementor. Other builders can use the [visual_compare] shortcode where they support normal WordPress shortcode rendering.

Which WordPress themes are supported?

VisualCompare is theme-independent and should work with themes that output normal WordPress content, widgets, shortcodes, and enqueued frontend assets. If a theme or builder disables WordPress shortcodes or strips plugin assets, use the native block or Elementor widget where available.

How do I use the shortcode?

Create a reusable comparison under Visual Comparisons and copy its shortcode, for example: [visual_compare id="123"] You can also create an inline comparison with attachment IDs: [visual_compare before="123" after="456" orientation="horizontal" start="50"]

Why is my slider not showing?

Make sure both images are valid WordPress image attachments. If a reusable comparison is used, confirm that the comparison is published and that the shortcode ID matches the saved item.

What happens if JavaScript is disabled?

Both images remain visible in a stacked layout. JavaScript progressively enhances the markup into an interactive comparison slider when it loads successfully.

Is VisualCompare accessible?

VisualCompare includes keyboard interaction, range input semantics, screen-reader instructions, labels, unique instance IDs, and a no-JavaScript fallback. Site owners should still provide meaningful image alt text and review final page content for their own accessibility requirements.

Will VisualCompare slow down every page?

The plugin registers its frontend assets but enqueues them only when a comparison is detected or rendered. Pages without comparisons should not load the VisualCompare frontend script or stylesheet.

Can I change the default slider settings?

Yes. Administrators can open Visual Comparisons > Settings and set defaults for orientation, starting position, interactions, aspect ratio, image fit, labels, divider style, handle size, and corner radius. Defaults apply to newly created comparisons and do not overwrite existing content.

Does uninstalling the plugin delete my comparisons?

No, saved data is preserved by default. Permanent cleanup must be explicitly enabled in Visual Comparisons > Settings before uninstalling the plugin.

更新日志:

1.0.2 1.0.1 1.0.0