ScrollSpy 👀

IMPORTING


<script src="//utkarsh48.github.io/scrollSpy/scrollSpy.js">
</script>
        

THIS WILL IMOPRT THE LIBRARY TO YOUR PROJECT

INIT


        <nav>
          <a data-pointsTo="aaaaa" href="#aaaaa">link 1</a>
          <a data-pointsTo="aaaa" href="#aaaa">link 2</a>
          <a data-pointsTo="aaa" href="#aaa">link 3</a>
          <a data-pointsTo="aa" href="#aa">link 4</a>
          <a data-pointsTo="a" href="#a">link 5</a>
        </nav>
    
        <section id="aaaaa" data-trigger="true"></section>
        <section id="aaaa" data-trigger="true"></section>
        <section id="aaa" data-trigger="true"></section>
        <section id="aa" data-trigger="true"></section>
        <section id="a" data-trigger="true"></section>
          
        <script src="./path/scrollSpy.js"></script>
        <script> new ScrollSpy(); </script>
      

ADITIONAL CONFIGS

FOR MORE CUSTOMISATION

let options={
  offsetTop: window.innerHeight/8,
  offsetBottom: window.innerHeight/8,
  links: "nav *", 
  linksTo: "[data-trigger]", 
  activeClassName: "active", 
  checkLowerBound: true 
}
new ScrollSpy(options);

CREDITS

DEV BEHIND

UTKARSH48