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.