Scroll to element
<p>How do I determine the index number of the element which text label matches to the one clicked?</p>

<p>I have a list:</p>

<pre><code>&lt;ul&gt;
  &lt;li data-cont="item one"&gt;this is one&lt;/li&gt;
  &lt;li data-cont="item 2"&gt;this is second&lt;/li&gt;
  &lt;li data-cont="one more"&gt;this is another one&lt;/li&gt;
&lt;/ul&gt;

...

&lt;div&gt;item one&lt;/div&gt;

&lt;div&gt;item 2&lt;/div&gt;

&lt;div&gt;one more&lt;/div&gt;
</code></pre>

<p>When one of LIs is clicked my screen needs to scroll down to one of the matched DIVs later on the page.</p>

<pre><code>$('#li').click(function(){
    var scrollNow = $(this).attr('data-cont');
    $('html, body').animate({
        scrollTop: $( 

        // here I need to scroll down to the item by index...

        ).offset().top
    }, 500);
});
</code></pre>
