Hello, you need a block to fix when scrolling when Top == 165; I do this:
$ (window) .scroll (function () {
if ($ (this) .scrolltop () & gt; 165) {
$ ('# View .fltrow'). CSS ({'Position': 'Fixed', 'Top': '165px', 'z-index': '999'});
} else {
$ ('# View .fltrow'). ATTR ('Style', '');
}
});
It turns out that the block when scrolling comes to top == 0, then it is sharply fixed on top == 165 (as if the feeling that jumps), but I need that the block does not reach Top: 0; Namely, Top 165 was immediately fixed, how to achieve such a result, I can not find materials in Google, tell me.
Answer 1
has long done such an example: http://jsfiddle.net/alpha9000/wxfb9/
He is also a response to this question: Floating block – How to remove fixation?
Look MB to you.