Using jQuery:
With $(window).on('scroll',function(){ /*your code*/ });
you can
bind a function to the scroll event.
Inside that function use document.scrollTop
to know the current
vertical position of the scroll bar
Change the css of the header and the side menu with .css()
or .addClass()
Finally with the HTML5 History API you can change the URL
without loading the page using the history.replaceState()
method.
I've just forked a plugin called Scrollit.js that does the job. The original version from Chris Polis works great but doesn't change the URL. My version does change the URL has't been completely tested.