CSS or jQuery : How to get visible top [duplicate]

You can do it with just plain css:

div {
   position: fixed;
   top: 0;
   display: none;
}

This will always be on top: 0 regardless of whether it is scrolled or not.

Leave a Comment