anchor.diff:    <!-- remove toc active class when page is loaded -->
     <script type="text/javascript">
       window.addEventListener('DOMContentLoaded', () => {
  -      var tocItems = $("#toc a");
  -
  -      for (let i = 0; i < tocItems.length; i++) {
  -        tocItems[i].classList.remove("toc-active");
  +      toc_items = document.querySelectorAll('#toc a')
  +
  +      for (let i = 0; i < toc_items.length; i++) {
  +        toc_items[i].classList.remove("toc-active");
         }
       })
     </script>
  
positive.code: 
    <!--handle page scroll top and bottom, add toc-active -->
    <script type="text/javascript">
      document.addEventListener('scroll', () => {
        //scroll to bottom
        if(document.documentElement.scrollHeight === window.pageYOffset + window.innerHeight) {
          var tocItems = $("#toc a");
          for (let i = 0; i < tocItems.length; i++) {
            tocItems[i].classList.remove("toc-active")
            };
            tocItems[tocItems.length - 1].classList.add("toc-active");
          };
        //scroll to top
        if(window.pageYOffset === 0) {
          var tocItems = $("#toc a");
          for (let i = 0; i < tocItems.length; i++) {
            tocItems[i].classList.remove("toc-active");
            };
            tocItems[0].classList.add("toc-active");
          };
        })
    </script>
  
    <!-- adjust alerts on mobile -->
    <script type="text/javascript">
      window.addEventListener("wheel", () => {
        if (window.innerWidth < 1425) {
          //adjust alert
          if(window.pageYOffset > 0) {
            document.querySelector('#support-alert').style.position = "fixed";
            document.querySelector('#support-alert').style.bottom = "0px";
            document.querySelector('#support-alert').style.margin = "5px";
            document.querySelector('#support-alert').style.zIndex = "9999999";     
          }
        }
     });
      window.addEventListener('resize', () => {
        if (window.innerWidth >= 1425) {
          document.querySelector('#support-alert').style.removeProperty('position');
          document.querySelector('#support-alert').style.removeProperty('bottom');
          document.querySelector('#support-alert').style.removeProperty('margin');
          document.querySelector('#support-alert').style.removeProperty('zIndex');
        }
      })
    </script>
  
negative.code:         e.map(i => {
            if (i.isIntersecting && i.intersectionRatio >= 1) {
              allTocLinks.forEach(link => link.classList.remove("toc-active"));
              toc_item = document.querySelector(`#toc li a[href="#${i.target.id}"]`)
              if(toc_item !== null) toc_item.classList.add('toc-active'); 
            }
          });
        };
  