ZoomImageMoveOptions type defines the configuration options for creating a move-based zoom interface where the cursor position controls the zoomed area, following the pointer movement.
Type Definition
Properties
The magnification level for the zoomed image. This determines how much larger the image appears when zoomed.Example:
URL of a higher resolution image to use for the zoomed view. If not provided, uses the source image’s
src attribute.This is useful for displaying a lower resolution preview image but showing a high-resolution version on zoom.Example:Scroll locking is automatically managed based on pointer type. Mouse interactions do not lock scroll, while touch interactions do.
Whether to disable the browser’s context menu (right-click menu) on the zoomed image. This also disables the long-press save image option on mobile devices.Useful for protecting images from easy downloading or copying.Technical details:
- Sets
-webkit-user-select: none - Sets
-webkit-touch-callout: none - Prevents
contextmenuevent - Prevents default
touchstartbehavior
Additional HTML attributes to apply to the zoomed image element.Properties:
alt?: string- Alternative text for the zoomed image (accessibility)className?: string- CSS class name(s) to apply to the zoomed image element
Related Types
ZoomImageMoveState
The internal state managed by the move zoom component:ZoomedImgStatus
idle- Not yet started loadingloading- Image is currently loadingloaded- Image has loaded successfullyerror- Image failed to load
Usage Example
Behavior Details
Pointer Tracking
The zoom follows the cursor/touch position in real-time:- Mouse: Zoom activates on
pointerenterand followspointermoveevents - Touch: Zoom activates on touch and follows finger movement
- The zoomed image is positioned to keep the cursor point centered
Scroll Lock Behavior
Scroll locking is automatically managed:- Mouse interactions: Scroll is NOT locked (allows normal page scrolling)
- Touch interactions: Scroll IS locked (prevents accidental page scrolling)
Boundary Constraints
The zoomed image position is constrained to prevent showing empty space:- Cannot pan beyond the image edges
- Automatically clamps position to valid range using
calculatePositionXandcalculatePositionY
Common Use Cases
Product Detail Pages
Protected Image Galleries
Medical or Technical Imaging
See Also
- createZoomImageMove - Function that uses these options
- ZoomImageWheelOptions - Options for wheel-based zoom
- ZoomImageHoverOptions - Options for hover-based zoom
- ZoomImageClickOptions - Options for click-based zoom