You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There are many examples of how to use PhotoSwipe on its website, but if we take a closer look, all the examples are creating a new instance of the same gallery on every thumb/button click on the same page with the same gallery, because PhotoSwipe is destroyed when you close it.
I'm a bit confused with the idea of creating a new instance of the same gallery every time I want to display PhotoSwipe, because you need to repeat the same actions on every click:
build the list of images
configure options
construct the gallery
init it
Of course (and we definitely will) cache the image list, options, but the approach of constructing a totally new gallery on every click seems to be and is, by definition, very inefficient.
What is the logic behind such approach?
The text was updated successfully, but these errors were encountered:
Maybe someone is still interested in this:
I ran into the same Problem. Creating a new instance every time causes a lot of traffic if larger images are used and a user opens and closes a gallery multiple times.
I get that there are only three images beeing loaded, but still.
Shouldn't therebe an open methode and why is the destrying methode insepreable from the closing methode without editing the core code?
There are many examples of how to use PhotoSwipe on its website, but if we take a closer look, all the examples are creating a new instance of the same gallery on every thumb/button click on the same page with the same gallery, because PhotoSwipe is destroyed when you close it.
I'm a bit confused with the idea of creating a new instance of the same gallery every time I want to display PhotoSwipe, because you need to repeat the same actions on every click:
Of course (and we definitely will) cache the image list, options, but the approach of constructing a totally new gallery on every click seems to be and is, by definition, very inefficient.
What is the logic behind such approach?
The text was updated successfully, but these errors were encountered: