How to prevent the auto Scroll Event while loading new HTML contents?
<p>I am using window.scroll() function for appending more html contents to the DIV holder while scrolling . I am loading 10..10 each on each scroll event. But after loading the first 10 contents, the document size increasing and accordingly the browser automatically scrolls and calling the loadContent function and appending new contents without doing the scroll manually.how can i prevent this mechanism.I need to load further contents only when the user Scrolls the button.</p>

<pre><code>$(function(){
  var loading = true;
  $(window).scroll(function(){
  if ( loading &amp;&amp; $(window).scrollTop() + $(window).height() &gt; $(document).height() - 100 ){
        loading = false;
        loadContents();
        loading = true;
 }
 });
 )};
</code></pre>

<p>Is there any other better way to perform the infinite scrolling functionality?</p>
