Documentation

Component: Image Zoom Interactive image magnifier with mouse tracking

The Image Zoom module creates a magnifying glass effect that enlarges an image when the user hovers over it. The zoomed image follows the mouse position, allowing users to inspect details easily.

Overview

This component creates a zoomed clone of the image when the mouse enters the container. The clone moves according to the mouse position to simulate a magnifier effect.

  • Image magnifier effect
  • Mouse tracking zoom
  • Adjustable zoom level
  • Automatic clone cleanup
  • Zero dependencies

Basic usage

Wrap an image with a container that has the data-anim-zoom attribute. The value defines the zoom multiplier.

Basic example

<div data-anim-zoom="3">
   <img src="@img/animmaster-pic.jpg" alt="">
</div>

Required structure

The zoom container must contain an image element.

HTML structure

[data-anim-zoom]
   img

Zoom level

The zoom multiplier is defined by the value of data-anim-zoom.

  • data-anim-zoom="2" — small zoom
  • data-anim-zoom="3" — default zoom
  • data-anim-zoom="5" — strong zoom

How it works

  1. User moves the mouse over the image container
  2. The script clones the image
  3. The clone is enlarged according to the zoom multiplier
  4. Mouse movement changes the position of the zoomed image
  5. When the mouse leaves, the cloned image is removed

Download

Use the Image Zoom module to create interactive product images, galleries, or detail previews with a lightweight and dependency-free solution.