I don't know how to explain my question in the title... :D I made a photo gallery and want to make the images, info, etc to be shown in an overlay. Everything works nice, but I would like the URL to be changed to the image page URL. As example I could name the galleries of Pinterest. Thx for your help or any ideas how I could go on searching!
Asked
Active
Viewed 157 times
1 Answers
1
I'd suggest looking into the HTML5 History API and pushState()
more specifically. I can't write an implementation here, but that's the basic answer to your question – the History API will let you change the URL without reloading the page. The real challenge you'll run into is how to handle history navigation from there (using JS to attach a listener for navigation) and to receive a URL for the gallery as generated by JS and show the right image within it.

Ben Saufley
- 3,259
- 5
- 27
- 42
-
Thx man! I found it a minute ago :D wanted to comment that! Found it here http://stackoverflow.com/questions/12446317/change-url-without-redirecting-using-javascript – Enrique Oct 29 '16 at 18:41
-
Great! Would you mind, then, marking my answer as Correct? – Ben Saufley Oct 29 '16 at 18:49