This version is old school.
Please find jQuery plugins on npm.
PageScroll jQuery Menu Plugin
by Pantherius
Customizable Mobile-Ready jQuery Menu, recommended for any website, best for Landing Pages.