Skip to content

Javascript Waypoints (or alternative)

I tryied to use the Waypoints library to fire an event when we scroll to the end of a div (in order to implement an “infinite scolling”-like functionality). I looked at this example but it apparently doesn’t work if I use a custom scrollable ‘div’, it only works for the window scrolling. Here my fiddle:

 var waypoint = new Waypoint({
  element: document.getElementById('waypoint'),
  handler: function(direction) {
  offset: 'bottom-in-view' 

Am I right? Is there an alternative?


This is possible to do with Waypoints by setting the context option to the scrollable element.