Frontend dev question
- Started
- Last post
- 9 Responses
- Nightshade
Look at this site: http://www.petrslobodzian.com
If you click on an image, a lightbox style popup appears. It happens quickly and seemingly without a page load, so it looks like a popup. Indeed if you look at FireBug's Net panel, it seems to load the popup content in 'on top' of the homepage content.
But look at the URL, its changed to something like http://www.petrslobodzian.com/Ya…
How is this possible? I looked into changing the URL in the browser via JQuery, but found it's only possible when you use an anchor (eg http://www.petrslobodzian.com/#Y…)
- uan0
html 5 in chrome, safari, FF
http://spoiledmilk.dk/blog/html5…
- Hombre_Lobo0
no idea how it does that, but fyi the images load after clicking on my machine.
- Nightshade0
Ahh yeah I found pushState in the JS code, thanks Uan
- phatwrx0
No IE support through IE9, go figure
- Fuzziest0
Any other good examples of this onpopstate event being used?
- dbloc0
this will change the URL
var newURL = $(this).attr("id");
url = "http://www.coolwebsite.com/" + newURL + "/";
window.location = url;
- sublocked0
Nightshade they're probably using Backbone or something similar. It does that built in...
- ahli0
Thanks for bringing this up, Nightshade!
...just added this functionality to a retail site I'm working on and its really gold-plated the experience!