title: How to get the real scroll height of div (say, inner text size)
body: <p>I'm trying to make a auto-scrolling div that go to its top when it reaches the end. But it doesn't work...</p>
  
  <pre><code>function    scrollPannel()
  {
      var pannel = document.getElementById('pannel');
      if (typeof scrollPannel.count == 'undefined')
      {
          scrollPannel.count = 0;
      }
      else
      {
          scrollPannel.count += 2;
      }
  // trouble is here
      if ((scrollPannel.count - pannel.scrollHeight) &gt; pannel.clientHeight)
      {
          scrollPannel.count = 0;
      }
      pannel.scrollTop = scrollPannel.count;
      setTimeout('scrollPannel()', 500);
  }
  </code></pre>
  
  <p>HTML:</p>
  
  <pre><code>&lt;div id='pannel'  style="height:200px;overflow:auto" onmouseover="sleepScroll()"&gt;
      &lt;p&gt;...&lt;/p&gt;&lt;!-- long text --&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>And after, I will need to find how to stop scrolling when "onmouseover" occures.</p>
  
  <p>EDIT: I did not explained the problem clearly. In fact, I have tried something like:</p>
  
  <pre><code>if (scrollPannel.count &gt; pannel.scrollHeight)
  {
      scrollPannel.count = 0;
  }
  </code></pre>
  
  <p>The problem is that scrollHeight seems greater than div inner text. So it makes a lot of time to return to the top. </p>
  
  <p>So I need an element property of which I could use the value to compare with my count variable. However I don't know Javascript a lot and I could not find anything. I hope it is as well simple as I think of it.</p>