Is there a way to change where “previous” button in browser goes?
The problem is the following:
- User enters page
- User clicks thumbnail image
- Large image appears in popup window (lightbox) and URL CHANGES from http://example.com/ to http://example.com/this-image-link/
- I click “Previous” button in browser and URL CHANGES from http://example.com/this-image-link/ to http://example.com/ but POPUP doesn’t disappear (and page doesn’t refresh).
How would I make it go back to http://example.com/ and close my popup after clicking “Back” in browser?
I suggest you do some reading on manipulating the browser’s history. Those links will certainly give you a good intro:
History API
MDN Manipulating the Browser History
This JS Library should also help you, if you want to overcome cross-browser limitations and evade JQuery, as suggested above.
History.js