0

I am not a good Javascript Programmer and so im coming to this question. I am using Photoswipe for some galleries in a project. Some galleries i dont use the thumbnail preview im opening them directly. Now, when i click the close button the image disappears and you can see just a blank page. Now i want to use the close button as a back in history function. I am using jquery and the photoswipe plugin, no jquery mobile or sansa touch.

Thanks for your help Michael

public9nf
  • 1,311
  • 3
  • 18
  • 48

2 Answers2

0

add the following to the button:

onclick="history.go(-1)

Now your button will look something like

<a href="#" onclick="history.go(-1)">Close</a>
krilovich
  • 3,475
  • 1
  • 23
  • 33
0

You should add to your custom script.js

var options = {
                ...,
                history: false,
                ...
};

And then initialize the gallery

var gallery = new PhotoSwipe( pswpElement, PhotoSwipeUI_Default, items, options);
gallery.init();
titockmente
  • 312
  • 1
  • 2
  • 6