title: Load content while scrolling a div with jquery
body: <p>I need to load content while scrolling a <b>div</b>, not window.
  That's my CSS code:<br></p>
  
  <pre><code>#sidebar{
   width:30%;
   float:right;
   height:455px;
  }
  #video_list{
    height:100%;
    overflow:auto;
  }
  </code></pre>
  
  <p>And this is my html code:</p>
  
  <pre><code>&lt;div id="sidebar" &gt;
   &lt;!-- other --&gt;
   &lt;div id="video_list"&gt;
   &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>Video_list is scrollable and the content is loaded by ajax call.
  When I go to the end of scrollbar i need to load content again.
  How can i determine the height of scrollable div ?
  I tried this:</p>
  
  <pre><code>if ($("#video_list").scrollTop()==$("#video_list").height()){
    loadContent();
   }
  </code></pre>
  
  <p>but it doesn't work !</p>