• Hi,

    PhotoSwipe supports a zoom transition when clicking on a thumbnail and opening the lightbox. I manually edited

            showHideAnimationType: 'fade',

    in the frontend.min.js to

            showHideAnimationType: 'zoom',

    but unfortunately, it still fades.

    I’m aware of the problems with the zoom animation and e.g. square thumbnails, but as my thumbnails have the original aspect ratio, I really would appreciate this animation.

    Do I have to change anything else to make it work? Or is it simply not possible with how the plugin is setup?

    Cheers

    • This topic was modified 8 months, 1 week ago by macglide.
Viewing 1 replies (of 1 total)
  • Plugin Author Arno Welzel

    (@awelzel)

    Short: no, using a zoom opening transition is not possible due to the way how the plugin works. You can only use fade or none.

    Longer answer:

    The plugin does not use the PhotoSwipe default code to build image collections based on DOM selectors. Instead the backend will identify the links which link to an image and add data-attributes for the frontend. The frontend will then collect all these links when clicking an image and builds a collection of images which will then be passed to PhotoSwipe.

    The visible images you can click are not used at all for anything. In fact only the linked images are used and you can even just add a link to an image without a thumbnail as well. Therefore there is no thumbnail which PhotoSwipe can use as start image for the zoom animation and therefore it falls back to a fade transition even when you ask for zooming.

    You can verify this by changing the animation type to none – then you will see, that it will not fade in but just open the lightbox immediately. So the option works, but zoom also requires a smaller image element known to PhotoSwipe where the zoom starts.

    To make zooming possible, I would have to add additional code to identify the visible thumbnails and tell PhotoSwipe about it in a custom filter callback (not a WordPress filter but a PhotoSwipe filter). It can be done, but it would need more than just a few minutes of work to be done. So for now you have to live with it as it is, sorry. Maybe I will add this option in future versions – so far this was not done, since I did not have the intention to support zooming animations anyway.

    If anyone is willing to help with this – the code is here and contributions will be credited of course: https://codeberg.org/askaaron/lightbox-photoswipe

    And I also created an issue for this: https://codeberg.org/askaaron/lightbox-photoswipe/issues/109

Viewing 1 replies (of 1 total)

The topic ‘Zoom animation’ is closed to new replies.