malaman / js-image-zoom

Image zoom on mouse hover for desktop browsers without external dependencies
http://malaman.github.io/js-image-zoom/example
MIT License
214 stars 37 forks source link

Scrolling messes up zoom lens positioning #25

Open GJordao opened 3 years ago

GJordao commented 3 years ago

If I scroll while hovering an image the zoom lens position gets stuck. It should perhaps reset on scroll?

I've uploaded a video to show the behaviour.

https://user-images.githubusercontent.com/21367039/104570354-b7bab500-5649-11eb-9752-5bacb854830f.mov

GJordao commented 3 years ago

Any news on this issue? It's blocking us from using this feature in production

flomar77 commented 2 years ago

I had the same problem with multiple zoomed images on one page. I resolved it by "reinitiating" the zoom:

const initZoom = () => { return ImageZoom() };
let zoom = initZoom();
zoom.kill(); 
zoom = initZoom();