waypoint.disable()

Parameters

None.

Returns

The same Waypoint instance, allowing chained method calls.

Disables the waypoint, preventing the handler function from triggering.

If you wish to re-enable the waypoint you can call enable. If a waypoint is crossed while it is disabled those triggers do not accumulate and fire when renabled. They are lost. This is the point of disabling.

Scroll down to view an example.

var waypoint = new Waypoint({
  element: document.getElementById('disable-enable-example'),
  handler: function(direction) {
    notify('I am enabled')
  },
  offset: 'bottom-in-view'
})

$('button.disable').on('click', function() {
  waypoint.disable()
})

$('button.enable').on('click', function() {
  waypoint.enable()
})