user1968523
user1968523

Reputation: 23

Photoswipe close gallery button code

I have already tried to close the Photoswipe screen gallery using history.go(-1); but it takes me to the previous screen where my gallery was. How can I close the Photoswipe screen gallery using code staying in the page where I call my gallery? Thanks in advance.

Upvotes: 1

Views: 1296

Answers (1)

Ufuk Hacıoğulları
Ufuk Hacıoğulları

Reputation: 38478

I managed to do it with this line:

window.Code.PhotoSwipe.activeInstances[0].instance.hide();

Upvotes: 2

Related Questions