title: Find first scrollable parent
body: <p>I have this situation in which I need to scroll an element into the viewport. The problem is that I don't know which element is scrollable. For example, in Portrait the body is scrollable and in Landscape its an other element (and there are more situation which change the scrollable element)</p>
  
  <p>Now the question, given an element which needs to be scrolled into the viewport, what is the best way to find its first scrollable parent ?</p>
  
  <p>I've setup a demo <a href="https://jsfiddle.net/pjzj9twe/" rel="noreferrer">here</a>. With the button you can toggle between two different situations</p>
  
  <pre><code>&lt;div class="outer"&gt;
      &lt;div class="inner"&gt;
          &lt;div class="content"&gt; 
              ...
              &lt;span&gt;Scroll me into view&lt;/span&gt;
          &lt;/div&gt;
      &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>The body is scrollable or <code>.outer</code></p>
  
  <p>Any suggestions ?</p>