I have a div.scroll_fixed with the following CSS
.scroll_fixed { position:absolute top:210px } .scroll_fixed.fixed { position:fixed; top:0;
use css property position:sticky to get it.
position:sticky
Here is the article explained and live demo.
http://updates.html5rocks.com/2012/08/Stick-your-landings-position-sticky-lands-in-WebKit
the only drawback is browser compatibility.