Description
js-image-zoom is a pure JavaScript utility that shows a zoomed view of an image when the mouse hovers over it, on desktop browsers. It has no external dependencies. You pass it a container element that holds the image, and options control the rest. The options include the width and height of the source image, fillContainer for when the image size is not known, zoomWidth for the width of the zoomed image, and scale, which is calculated from the natural image size if you do not set it. You can set the offset of the zoomed image, choose where it appears (top, left, bottom, right or original), attach it to a different DOM element, and add custom styles to the zoomed image and the lens. If the container does not hold an img element, you can give the image URL with the img option. The README includes a basic example that you can open in a browser and a demo. For React projects there is a separate React wrapper called react-image-zoom. The project is for websites that show product or photo images and want a simple zoom on hover without a large library.…
Highlights
- Zoom on mouse hover, desktop browsers only
- No external dependencies
- Zoom position: top, left, bottom, right or original
- Custom offset, lens and zoom styles
- React wrapper available
Ratings & Reviews
No ratings yet
Be the first to rate JS Image Zoom.
People also visit

react-inner-image-zoom
A React component for magnifying an image within its parent container
zoom-image
A little yet powerful framework agnostic library to zoom image on the web
Starlight Image Zoom
Starlight plugin adding zoom capabilities to your documentation images
JS Image Zoom FAQ
What does js-image-zoom do?
It shows a zoomed view of an image when the mouse hovers over it on a desktop browser.
Does it work on phones?
The README says it is for desktop browsers. It does not describe touch zoom.
Does it need other libraries?
No. The README says it is pure JavaScript with no external dependencies.
Where does the zoomed image appear?
You choose top, left, bottom, right or original, using the zoomPosition option. The default is right.
Is there a React version?
Yes. The README links to a React wrapper called react-image-zoom.
What are the best JS Image Zoom alternatives?
Popular alternatives to JS Image Zoom include Viewerjs, Zoom Image and Starlight Image Zoom. See all JS Image Zoom alternatives









