Photoswipe: After Open event

Created on 20 Aug 2015  路  4Comments  路  Source: dimsemenov/PhotoSwipe

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

Implementation Question

Most helpful comment

If you mean after zoom-in transition finishes, the event is initialZoomInEnd. There is also afterInit, but it fires directly after init().

All 4 comments

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()

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ergec picture ergec  路  3Comments

JoffreyT picture JoffreyT  路  5Comments

tezma90 picture tezma90  路  3Comments

arnowelzel picture arnowelzel  路  5Comments

rnnyrk picture rnnyrk  路  5Comments