title: catch when user scrolls to near the end of the full width of a scrollable div
body: <p>I need to notify when a user gets near the end of a horizontal scrollable div.</p>
  
  <p>I know notification on the end of a page scrollbar can be achieved like this:</p>
  
  <pre><code>$(window).scroll(function() {
    if (document.body.scrollHeight - $(this).scrollTop() &lt;= $(this).height()+500) {
       alert('near end');             
    }
  });
  </code></pre>
  
  <p>However on a scrollable horizontal div like this: <a href="http://jsfiddle.net/DBY4D/1/" rel="nofollow">Example</a> how can I get the notification once the user gets to near the end of the scrollable area?</p>