francoischalifour / medium-zoom

🔎🖼 A JavaScript library for zooming images like Medium
https://medium-zoom.francoischalifour.com
MIT License
3.64k stars 165 forks source link

Image being centered to the height of page height and not viewport height #163

Open mckeever02 opened 3 years ago

mckeever02 commented 3 years ago

I noticed something that I think is related to the fix implemented for Issue #75

In this issue the code was changed from:

width: window.innerWidth,
height: window.innerHeight, 

to:

width: document.documentElement.clientWidth,
 height: document.documentElement.clientHeight,

However, this leads to the image (for me) being displayed off of the screen as it gets positioned to the height of the document and not the screen. When I change it back to window.innerHeight it works correctly.

francoischalifour commented 3 years ago

Can you share screenshots of how this works better in your case?