title: IScroll scrollToElement not working
body: <p>I'm trying to use the scrollToElement function from the IScroll library, but I can't get it to work.</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>new IScroll(document.querySelector(".wrapper")).scrollToElement(document.querySelector("h2"));</code></pre>
  <pre class="snippet-code-css lang-css prettyprint-override"><code>.wrapper {
      background-color: red;
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;script src="https://cdnjs.cloudflare.com/ajax/libs/iScroll/5.1.3/iscroll.js"&gt;&lt;/script&gt;
  
  &lt;div class="wrapper"&gt;
       &lt;h1&gt;This is H1&lt;/h1&gt;
  
       &lt;h1&gt;This is H2&lt;/h1&gt;
  
       &lt;h1&gt;This is H3&lt;/h1&gt;
  
       &lt;h1&gt;This is H4&lt;/h1&gt;
  
       &lt;h1&gt;This is H5&lt;/h1&gt;
  
       &lt;h1&gt;This is H6&lt;/h1&gt;
  
       &lt;h1&gt;This is H7&lt;/h1&gt;
  
       &lt;h1&gt;This is H8&lt;/h1&gt;
  
       &lt;h1&gt;This is H9&lt;/h1&gt;
  
       &lt;h1&gt;This is H10&lt;/h1&gt;
  
       &lt;h1&gt;This is H11&lt;/h1&gt;
  
       &lt;h2&gt;This is H12&lt;/h2&gt;
  
       &lt;h1&gt;This is H13&lt;/h1&gt;
  
       &lt;h1&gt;This is H14&lt;/h1&gt;
  
       &lt;h1&gt;This is H15&lt;/h1&gt;
  
       &lt;h1&gt;This is H16&lt;/h1&gt;
  
       &lt;h1&gt;This is H17&lt;/h1&gt;
  
       &lt;h1&gt;This is H18&lt;/h1&gt;
  
       &lt;h1&gt;This is H19&lt;/h1&gt;
  
  &lt;/div&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>As you can see, I'm just trying to scroll to the h2 element, but nothing happens.</p>
  
  <p>What am I doing wrong?</p>
  
  <p>Thanks in advance!</p>
  
  <p><a href="http://jsfiddle.net/8jfaoptz/" rel="nofollow">jsfiddle</a></p>