javascript - Update nav bar links to active and smooth scrolling -


i trying implement nav bar list of <a> tag navigate different part of current page , tag should change class active when user scrolling through page.

not sure best way implement on vue app not want use bootstrap jquery on it.

i found framework agnostic library: https://github.com/cferdinandi/gumshoe , smooth scrolling works, anchor tags not being set active. tried couple of other libraries implement updating of active no avail.

so not sure if setting external libraries correctly in vue.

what did include in index.html

<body>   <div id="app"></div>   <!-- built files auto injected -->   <script src="static/js/gumshoe.js">   </script>   <script src="static/js/smooth-scroll.min.js">   </script>   <script>     smoothscroll.init({       offset: 20     });     gumshoe.init(); </script> </body> 

usage

<ul class="nav-right-items" data-gumshoe>   <li class="">     <a data-scroll href="#about" class="">about me     </a>   </li>   <li class="">       <a data-scroll href="#experience" class="">experience       </a>   </li> </ul> 


Comments

Popular posts from this blog

ubuntu - PHP script to find files of certain extensions in a directory, returns populated array when run in browser, but empty array when run from terminal -

php - How can i create a user dashboard -

javascript - How to detect toggling of the fullscreen-toolbar in jQuery Mobile? -