Hi, I need something like an after open event. I need to fire some commands just when the lighbox is created. The commands after pswp.init() run before the lightbox is created, so I need to set a timeout, but that is not precise.
Is there any event that fires after the lightbox is created?
Thanks
If you mean after zoom-in transition finishes, the event is initialZoomInEnd. There is also afterInit, but it fires directly after init().
Thanks, that's what I was looking for. I thought initialZoomInEnd was going to fire when I zoomed the image from PhotoSwipe.
i would like to call function only after the image is displayed on the lightbox so after init is complete. afterInit not work:
PHOTOSWIPEOBJECT.listen('afterInit', function() {...});
gallery.listen('afterInit', function(index, item) {
debugger
});
gallery.init();
afterInit must write before init()
Most helpful comment
If you mean after zoom-in transition finishes, the event is
initialZoomInEnd. There is alsoafterInit, but it fires directly afterinit().