Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Initial Zoom Issue when Image is Smaller than the viewport #2113

Open
lacwebadmin opened this issue Jul 23, 2024 · 4 comments
Open

Initial Zoom Issue when Image is Smaller than the viewport #2113

lacwebadmin opened this issue Jul 23, 2024 · 4 comments

Comments

@lacwebadmin
Copy link

When the image size is smaller than the viewport, the initial zoom will show the image like a shadow at the bottom. I don't how to describe it but here's the screen capture:

image

Here's where you can see it: https://codepen.io/frogydiak/pen/XWLKGXp

I intentionally made the last slide image smaller, the original size is w:2500 h:1666. I wonder what's causing it.

@dimsemenov
Copy link
Owner

I intentionally made the last slide image smaller, the original size is w:2500 h:1666

You changed it to 1440x810, which is a different aspect ratio compared to the original.

@lacwebadmin
Copy link
Author

@dimsemenov In my website, I have photos that were sized 1440x810 as original and that this is still happening. Are you saying, that the data-pspw-height and width should be the original size of the photo?

@dimsemenov
Copy link
Owner

You need to provide correct image dimensions in the data-pswp-width and height attributes. Also, for zoom opening animation thumbnails aspect ratio must match the large image.

@lacwebadmin
Copy link
Author

lacwebadmin commented Jul 25, 2024

@dimsemenov Sorry, I'm new to PhotoSwipe but I cannot find any parameters that controls the zoom opening animation thumbnails aspect ratio. Can you point me to where do I set that please? I am just following the documentation and expect it to work but I guess not. Is it in CSS?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants