Hacker News new | ask | show | jobs
by ryansouza 3736 days ago
Neat!

Annoyingly it seems every time you scroll pass one of the maps a browser history entry is pushed

2 comments

They always keep 2 iframes loaded; when you scroll down (or up) the old iframes are unloaded by setting their src="" and the new ones are loaded by setting their src attribute to the correct URL (kept the "source" attribute of the iframe).

However, when you change the src attribute of an iframe, for some reason your browser creates a new history frame. I suppose so you can navigate inside of an iframe and go back/forward as expected.

The correct solution is to create/remove the entire iframe element instead of reassigning the src attribute.

See discussion at http://stackoverflow.com/questions/14737365/modify-iframe-sr...

You can see it in the HTML source of the page around the "check visibility every half-second, hide off-screen demos to go easy on the GPU" comment.

oh the humanity