title: Function scrollIntoView doesn't work
body: <p>I have a little problem with my function <code>scrollIntoView</code>. Indeed, it doesn't work :(</p>
  
  <p>This is my code:</p>
  
  <ul>
  <li><p>HTML</p>
  
  <pre><code>&lt;section class="page_mission"&gt;
    &lt;div class="page_mission_text"&gt;
      &lt;div class="scroll-animations"&gt;
        &lt;div class="animated fadeInLeft"&gt;
          &lt;h2&gt;Design &lt;i class="fab fa-css3-alt"&gt;&lt;/i&gt;&lt;i class="fab fa-html5"&gt;&lt;/i&gt;&lt;/h2&gt;
          &lt;p&gt;Blablabla&lt;br&gt;&lt;/p&gt;
        &lt;/div&gt;&lt;hr style="width: 75%;"&gt;
        &lt;div class="animated"&gt;
          &lt;h2&gt;Modernité &lt;i class="fas fa-dna"&gt;&lt;/i&gt;&lt;/h2&gt;
          &lt;p&gt;Blablabla&lt;/p&gt;
        &lt;/div&gt;&lt;hr style="width: 75%;"&gt;
        &lt;div class="animated"&gt;
          &lt;h2&gt;Coûts &lt;a href="cost_popup.html" class="ajax-popup-link"&gt;&lt;i class="far fa-credit-card"&gt;&lt;/i&gt;&lt;/a&gt;&lt;/h2&gt;
          &lt;p&gt;Blablabla&lt;/p&gt;
        &lt;/div&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/section&gt;
  </code></pre></li>
  <li><p>JS</p>
  
  <pre><code>$(document).ready(function() {
     function isScrolledIntoView(elem) {
         var docViewTop = $(window).scrollTop();
         var docViewBottom = docViewTop + $(window).height();
  
         var elemTop = $(elem).offset().top;
         var elemBottom = elemTop + $(elem).height();
  
         return ((elemBottom &lt;= docViewBottom) &amp;&amp; (elemTop &gt;= docViewTop));
      }
  
      $(window).scroll(function() {
          $('.scroll-animations .animated').each(function() {
              if (isScrolledIntoView(this) === true) {
                  $(this).addClass('fadeInLeft');
  
              }
      });
  });
  </code></pre></li>
  </ul>
  
  <p>Does someone have an idea what's wrong?
  Thanks a lot!</p>