ui icon indicating copy to clipboard operation
ui copied to clipboard

Click to zoom off-center

Open 51graphix opened this issue 3 years ago • 4 comments
trafficstars

On click to zoom, the image is zoomed to clicked coordinates, but does not stick to the edges of the viewport, leaving a gap on one side when clicking near the edge of an image. This seems to be unique to v4 and was not the default behavior on v3.

zoomInCentered mentioned from panzoom options page in documentation is also missing from Panzoom.js, not sure if that is part of the problem?

If this is intentional, is there a way to revert to the default zoom behavior on v3?

fancybox4_offcenter

51graphix avatar Mar 17 '22 20:03 51graphix

Hi,

Fancybox v4 supports multiple zoom levels, and drag/zoom boundaries are edges of the original image. So you want these boundaries to be at the edges of the viewport, but, sorry, there is currently no option for that.

Does that really bother you? I'm currently working on the next major version and I might try to add an option to customize that.

fancyapps avatar Mar 22 '22 10:03 fancyapps

Personally, that's what I believe should be the default behavior. As it stands now, you end up with lots of screen real estate left empty, which on small devices doesn't make much sense to me. If you could have an option to revert this behavior back to the way it was on v3, that would be great.

Couple screenshots showing expected behavior, where user clicks on bottom right of image, and image is zoomed into the bottom right corner, but still fills the viewport.

fancybox-click fancybox-clicked

51graphix avatar Mar 22 '22 11:03 51graphix

Thanks for your feedback. I thought about it and you are right, this will be the default behavior for v5.

fancyapps avatar Mar 22 '22 11:03 fancyapps

Excellent, look forward to seeing other improvements for v5. Great work, love the script.

51graphix avatar Mar 22 '22 11:03 51graphix

Hi,

Well, v5 has been released recently and it should work as expected.

fancyapps avatar Feb 24 '23 15:02 fancyapps