Waypoint.destroyAll()

Parameters

None.

Returns

undefined.

Destroys all Waypoints. This is the same as calling destroy on every waypoint, or calling destroy on every context.

Scroll down to view an example.

var elements = document.getElementsByClassName('.destroy-all-waypoint')
elements.forEach(function(element) {
  new Waypoint({
    element: element,
    handler: function(direction) {
      notify(this.element.innerHTML + ' still alive')
    },
    offset: 'bottom-in-view'
  })
})

$('button.destroy-all').on('click', function() {
  Waypoint.destroyAll()
})

Waypoint 1
Waypoint 2
Waypoint 3
Waypoint 4
Waypoint 5
Waypoint 6
Waypoint 7
Waypoint 8