title: iscroll scrollToElement not updating currPage variable
body: <p><em>UPDATE:
  I was able to get my scroller working as desired but I feel like I have hacked around the actual issue and would love it if anyone has a more solid answer, I've updated and noted in the snippets below the new jQuery I'm using.</em></p>
  
  <p>I'm using iScroll-4 (<a href="http://cubiq.org/iscroll-4" rel="nofollow">http://cubiq.org/iscroll-4</a>) for an iPad/Android web app, everything's working perfectly with the swipes and scrolling but I have a table of contents at the beginning of the app that allows users to jump to specific areas of the scroller --</p>
  
  <p>I'm using the iScroll function <code>scrollToElement(element, duration)</code> in order to jump to the different areas. Also using <code>scrollToPage(page, duration)</code> to allow the user to manually navigate forward and backward one page at a time.</p>
  
  <p>While watching the console logs the <code>currPageX</code> variable updates when I navigate with the <code>scrollToPage</code> function and when I swipe, but when using the <code>scrollToElement</code> the <code>currPageX</code> variable does not update.</p>
  
  <p>Therefore if I jump to an element and then navigate forward with <code>scrollToPage('next', 0)</code> it will go backwards and navigate me to the next page after the table of contents.</p>
  
  <p>I have tried using the <code>scroll.refresh()</code> function after <code>scrollToElement</code>, before, putting the function inside a timeout, etc. and I can't figure out why the <code>currPageX</code> is not updating. </p>
  
  <p>Here's a snippet of the jQuery code that I'm using the two different functions:</p>
  
  <pre><code>  // TO NAVIGATE FORWARD AND BACKWARDS
    $('span.control').on('click', function() {
      var slideDir = $(this).attr('data-dir');
      if (slideDir == 'prev') {
        var tehPg = tehScroll.currPageX-1;
      } else if (slideDir == 'next') {
        var tehPg = tehScroll.currPageX+1;
      }
      tehScroll.scrollToPage(tehPg, 0);
      return false;
    });
  
    // TO JUMP FROM CONTENTS
    $('li[data-page="toc"] span').on('click', function() {
      var toPage = $(this).attr('data-page');
      tehScroll.scrollToElement('li[data-page="'+toPage+'"]', 800);
      // ADDED THE FOLLOWING LINE TO MANUALLY SET currPageX after scrolling!
      tehScroll.currPageX = $('#slides li[data-page="'+toPage+'"]').index();
      return false;
    });
  </code></pre>