fat / zoom.js

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

change the zoom-overlay position to fix #70 #78

Open geekplux opened 8 years ago

geekplux commented 8 years ago

fix #70

change the zoom-overlay position from the <body> child to .zoom-img-wrap bro.

ElegantSudo commented 8 years ago

Awesome effort, but this doesn't fix the issue we were describing.

Read this: https://github.com/fat/zoom.js/issues/77

geekplux commented 8 years ago

@ElegantSudo Thanks. My code LGTM for me and just fix #70 . What you described in #77 is anther way to fix the problem, I think.. And it seem unconcerned for author about this..😓

ElegantSudo commented 8 years ago

It's evident that the author doesn't care.

I'm developing a fix right now to the problem. I tried yours out, but it wasn't working.

geekplux commented 8 years ago

ahh, How about having a try: change the one line code

document.body.appendChild(this._overlay)

to

this._targetImageWrap.parentNode.insertBefore(this._overlay, this._targetImageWrap)

It works for me only changed this. 😝I just tried it again.

ElegantSudo commented 8 years ago

@geekplux In my case, that doesn't work. If I do that, the white overlay won't show and the image is still cut off when it overflows its parent.

geekplux commented 8 years ago

hmm..Do you make sure your CSS and JS are the latest?

geekplux commented 8 years ago

@ElegantSudo

You can refer to this: https://jsfiddle.net/GeekPlux/rym45g8c/

and..now is 3:30 am, I'm going to sleep ;) thank you again.