title: scrollTop to active element in a overflow scroll div
body: <p>I have a specific question about <code>.scrollTop</code>. I have a <code>div</code> with a specific <code>height</code> and a lot of p tags inside:</p>
  
  <pre><code>&lt;div id="scroll"&gt;
     &lt;p&gt;name1&lt;/p&gt;
     &lt;p&gt;name2&lt;/p&gt;
     &lt;!-- till name50 --&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>depending on the name you click it gets a class <code>.active</code>. What I then want to do is scroll the div so, that the name is at the top. So what I get is that I can use scrollTop in an animate function like this:</p>
  
  <pre><code>$('#scroll').animate({scrollTop: value });
  </code></pre>
  
  <p>but how can I get the <code>var value</code>. I tried it with</p>
  
  <pre><code>var value = $('#scroll p').hasClass('active').position().top;
  </code></pre>
  
  <p>But somehow it does not work.</p>
  
  <p>Some help is much appreciated.</p>