I was doing some snooping on the web and found window.location.hash = \"etc\"
to be a widely adopted method to update the browser\'s location without reloading
There are most likely two things going on here:
pushState
, but hash changes are
on the same code path).A workaround for both would be to defer the updating of the hash until the user is done scrolling (you can still update the white bar that appears under the current item immediately). You can do this by having something like:
var scrollTimeout;
window.onscroll = function() {
// update current item display here
if (scrollTimeout)
clearTimeout(scrollTimeout);
scrollTimeout = setTimeout(function() {
scrolTimeout = undefined;
// update hash here
}, 100);
};
Since it looks like you're using jQuery, there are debouncing plugins that may be helpful.