What you want to do is create a content container fixed. When it is fixed, the element itself cannot be scrolled (because it is fixed in the window). You can then determine the offset using the CSS topand attributes bottom.
CSS will look something like this:
.content {
top: 65px;
position: fixed;
bottom: 0;
overflow: auto;
}
JSFiddle.
Update
, , CSS. , DOM . , (), () - , , ( + ) .
- JavaScript. , background-position body. , :
$(".content").scroll(function() {
$("body").css("background-position", "0 -" + $(this).scrollTop() + "px");
});
, , .content , "".
JSFiddle, .
2
, , : DOM - , , , ( ).
, : . , <div> , JavaScript ( ). <div> . , , .
, , . + . , , JavaScript. , , , , , , , . , , .