Skip to main content
Drupal is a registered trademark of Dries Buytaert
Release: OpenID Connect / OAuth client 3.0.0-alpha9 New alpha version released for module openid_connect (3.0.0-alpha9). Usage Milestone: Google Analytics Module google_analytics crossed 1,000 active installs. Release: Timelinr 1.0.1 Minor update available for module timelinr (1.0.1). Release: GraphQL Compose Codegen 1.1.2 Minor update available for module graphql_compose_codegen (1.1.2). Release: Mapy.com 1.1.3 Minor update available for module mapycom (1.1.3). Release: Ckeditor5 entity browser 3.0.3 Minor update available for module ckeditor5_entity_browser (3.0.3). Release: Ckeditor5 entity browser 3.0.1 Minor update available for module ckeditor5_entity_browser (3.0.1). Release: Ckeditor5 entity browser 3.0.2 Minor update available for module ckeditor5_entity_browser (3.0.2). Release: Teamleader Integration 4.0.2 Minor update available for module teamleader (4.0.2). Module Revived: Entityqueue Buttons 1.1.2 Module entityqueue_buttons updated after 8 months of inactivity (1.1.2).

Zoom on hover

11 sites Security covered Drupal 10–11
View on drupal.org

This module enhances Drupal image fields with a high-performance JavaScript zoom effect. It allows users to magnify images using their mouse wheel or touch gestures and offers an optional fullscreen mode.

The Zoom on Hover module transforms standard Drupal image fields into a high-performance, interactive viewing experience for Drupal 10 and 11. Unlike older solutions, it is powered entirely by a custom JavaScript engine with zero third-party library dependencies (no jQuery, no xzoom.js). This ensures a lightweight footprint, lightning-fast load times, and maximum compatibility with modern decoupled or traditional Drupal themes.

Key Features

  • Custom JS Engine: Built from the ground up with vanilla JavaScript for superior performance and zero dependency overhead.
  • Scroll-to-Zoom: Interactive magnification control using the mouse wheel, supporting levels from 1× to 10×.
  • Native Touch Support: Smooth, flick-free zooming for mobile and tablet users via native touch-move event handling.
  • Click to Fullscreen: An optional built-in lightbox overlay featuring hardware-accelerated CSS animations.
  • GPU-Optimized: Utilizes translate3d and will-change CSS properties to ensure a consistent 60 fps rendering experience.

Installation

Install the module via Composer to ensure the codebase is properly structured within your Drupal project:

composer require drupal/zoom_on_hover

Enable the module using Drush:

drush en zoom_on_hover -y

Configuration

The module provides a field formatter that can be applied to any standard Image field:

  1. Navigate to Structure » Content types » [Your Type] » Manage display.
  2. Locate your image field and change the Formatter to Zoom on Hover.
  3. Click the gear icon on the right to configure the zoom mode, lens dimensions, and animation speeds.
  4. Save the display settings.

Zoom Modes

Choose the visual style that best fits your site's aesthetic:

  • Box: Displays an external preview panel beside the thumbnail. A tracking lens follows the cursor on the original image.
  • Circle: A classic circular magnifying glass effect overlaid on the image with a subtle darkened background.
  • Inside: A rectangular magnifier lens that reveals the zoomed-in details directly within the lens boundaries.
  • Background: The image pans and scales fluidly in-place within its own container—no extra panels or lenses required.

Requirements & Compatibility

  • Drupal: 10.0+ or 11.0+.
  • Browser Support: Modern evergreen browsers (Chrome, Firefox, Safari, Edge).
  • Zero External Libraries: No manual downloading of JS files to the /libraries/ folder is required.

Upgrading from Legacy Versions

Previous versions of this module relied on xzoom.js. The current version removes this dependency to modernise the stack.

CSS Notice: If your theme contains custom CSS overrides for .xzoom, .xzoom-container, or .xzoom-preview, please update your selectors to .zoom-image, .zoom-container, and .zoom-preview respectively.

Similar Projects

Support & Contribution

If you find a bug or have a suggestion for a new feature, please submit an issue in the official queue. Contributions via Merge Requests are highly encouraged!

Depends on

Dependencies of the latest stable release

  • field Drupal core
  • image Drupal core

Required by

Tracked projects that depend on this one

No tracked projects depend on this one yet.

Activity

Tracked releases
2
Tracked since
Feb 2026
Latest release
1 month ago
Releases (12 mo)
2 ▲ from 0
Maintenance
Active

Releases

Version Type Core Release date
1.1.4 Stable 10–11 Jul 29, 2026
1.1.3 Stable 10–11 Feb 19, 2026