Skip to content

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.

4 participants