The navigation bar is in the page, and then the page scrolls down, and the navigation bar is fixed at the top all the time. Is there a better solution?

Mobile, PC and Mini Program can all
I have implemented one. The principle is that by listening to the scroll bar, when the element reaches the top, it shows the element of fixed and hides the original element.
but the monitoring of the scroll bar will drop frames, and occasionally two navigation bars will appear. Is there a better solution?

Feb.09,2022

position sticky


simply do not understand what you are trying to say, the page scrolls down, the navigation bar is always fixed at the top, is that what you want to say?


iscroll-probe try to listen for smooth sliding distance

Menu