I have Googled for this, but you must use the wrong keywords.
Basically I want to use the effect that Magento uses and now Stack Overflow. That is, there is an element in the column, and when you scroll down, it adheres to the top of the viewport. And as soon as it scrolls again, it returns to the normal page flow.
This question asks, for example, a good page. Scroll down and see how the “How to format” item comes off (maybe you need to reduce the size of the viewport if you have a large screen to see the effect).
I noticed that it installs position: fixedin CSS. However, JavaScript is confusing.
What is the easiest way to achieve this effect? Is there a jQuery plugin available?
source
share