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

added natural image height and width without defined it with data-psw… #2048

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

spoitler
Copy link

The data-pswp-width and data-pswp-height still working, but now it is optional.

before

<ul id="my-gallery">
  <li>
    <a href="https://..." data-pswp-width="1669" data-pswp-height="2500" target="_blank">
      <img src="https://..." alt="" loading="lazy">
    </a>
  </li>
</ul>

after

<ul id="my-gallery">
  <li>
    <a href="https://..." target="_blank">
      <img src="https://..." alt="" loading="lazy">
    </a>
  </li>
</ul>

@dimsemenov
Copy link
Owner

I'm not sure that relying on thumbnail dimensions is a good idea, especially as a default behavior. The domItemData filter allows you to do this without modifying the lib.

@otary
Copy link

otary commented Aug 1, 2023

I think setting the default width and height is a good idea. Once the width and height preview is not set, there will be problems. Setting the default width and height can be used as a compatibility solution

@pxp1230
Copy link

pxp1230 commented Aug 19, 2023

Yes, this is not a big problem. Both data-pswp-width and data-pswp-height can be dynamically assigned after the image is loaded.

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

Successfully merging this pull request may close these issues.

None yet

4 participants