+1 vote
by
How to scroll up smoothly bring the menu down from the top, when you scroll up smoothly remove the top.
and start executing the js code, when scrolling over 400px
Initially, the menu was not fixed.
https://jsfiddle.net/ywa96n3c/

1 Answer

0 votes
by
If the menu is not fixed, you can use transform (CSS) - in the right positions of the menu will change (visually), but the effect on neighboring elements will not. Plus you can use transitions (CSS) on transform, and get smooth menu animation. You can do in JS through CSS-classes.
...