I have been seeing this thing for months and years and i really wanna know how to do that one.

For example, there is an element in the middle of the page. and it is in absolute position. When scroll downs and comes to that element, it becomes fixed positioned and follows the scroll, when scroll up and back to middle of the page it becomes absolute again.

I can give google adwords accounts page as an example, in the campaigns page, your keywords' header is the same thing.

how to do that one ?

thanks