fat / zoom.js

Medium's Image Zoom for jQuery
https://fat.github.io/zoom.js
MIT License
4.04k stars 332 forks source link

Save and restore the 'style' attribute of the original image. #88

Closed ggambetta closed 1 year ago

ggambetta commented 7 years ago

Using zoom.js with an image that has a non-trivial style before being zoomed in, zooming in works fine, but zooming out was placing the image somewhere else, because the original value of the style attribute was lost (in particular, the translate property).

This produces a slight visual glitch when zooming in at the default 300ms, but the glitch is absent when setting the delay to 3000ms, so I'm not sure whether it's a bug in my implementation (probably) or in Chrome (unlikely).