Peesen87 Peesen87 - 2 years ago 168
Javascript Question

Photoswipe / Use Close Button as History Back Button

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

Answer Source

add the following to the button:


Now your button will look something like

<a href="#" onclick="history.go(-1)">Close</a>
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download