title: .getBoundingClientRect() not changing values on scroll
body: <p>I am trying to make a side pagination bar, and I want it to change colors when different parts of the page come into view, so I am using the .getBoundingClientRect in javascript. However, everytime I scroll, the position of the element is the same in the console logs, even if I have scrolled all the way to the bottom.</p>
  <p>Can someone help me so that the values change when they are meant to?</p>
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>var aboutPage = document.getElementById('about');
  var aboutBounding = aboutPage.getBoundingClientRect();
  
  window.addEventListener("scroll", () =&gt; {
  
      console.log(aboutBounding);
  
      if (
          aboutBounding.top &gt;= 0 &amp;&amp;
          aboutBounding.left &gt;= 0 &amp;&amp;
          aboutBounding.right &lt;= (window.innerWidth || document.documentElement.clientWidth) &amp;&amp;
          aboutBounding.bottom &lt;= (window.innerHeight || document.documentElement.clientHeight)
      ) {
          console.log('In the viewport!');
      } else {
          console.log('Not in the viewport... whomp whomp');
      }
  })</code></pre>
  <pre class="snippet-code-css lang-css prettyprint-override"><code>/* SIDE PAGEINTATION */
  
  .side-pagination {
    position: fixed;
    top: 50%;
    left: 72px;
    height: 138px;
    width: 24px;
    transform: translateY(-50%);
    z-index: 10;
  }
  
  .page-circle {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background-color: #bcbcbc;
    cursor: pointer;
  }
  
  .page-circle.menuactive {
    background-color: var(--secondary-clr);
  }
  
  .page-circle:nth-child(1) {
    margin-bottom: 14px;
  }
  
  .page-circle:nth-child(2) {
    margin-bottom: 14px;
  }
  
  .page-circle:nth-child(3) {
    margin-bottom: 14px;
  }
  
  .landing-main-body {
    position: absolute;
    top: 0%;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
    background-color: gray;
  }
  
  .work-main-body {
    position: absolute;
    top: 200%;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
    background-color: pink;
  }
  
  .about-main-body {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
    background-color: purple;
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;div class="side-pagination"&gt;
    &lt;div class="page-2 page-circle"&gt;&lt;/div&gt;
    &lt;div class="page-3 page-circle"&gt;&lt;/div&gt;
    &lt;div class="page-4 page-circle"&gt;&lt;/div&gt;
  &lt;/div&gt;
  &lt;div class="landing-main-body"&gt;
  &lt;/div&gt;
  &lt;div class="about-main-body" id="about"&gt;
  
  &lt;/div&gt;
  &lt;div class="work-main-body" id="work"&gt;
  
  &lt;/div&gt;</code></pre>
  </div>
  </div>
  </p>
  <p>EDIT: I will try using IntersectionObserver in the morning, stay put till then :D.</p>