How to know when CSS position sticky get's applied
•2 min read
Often we require an element to have a position sticky when we scroll down the page. position: sticky can be thought as a combination of position: relative and position: fixed, an element remains in relative position until a point and then changes to fixed position.
.sticky {
position: -webkit-sticky; /* for safari */
position: sticky;
top: 0px;
}
above element would be in position relative untill it's 0px from top , after that it changes to position:fixed.
Prior to the sticky position, there was a JS solution to implement above behavior, which would require scroll event listener
###Support for position Sticky:

IE and previous versions of Edge browsers do not support sticky position, it can be resolved using stickyfill polyfill.