Shepherd Review
(Rated from 31 reviews)

Updated 09 May 2019 by Max

Global Shepherd Object Review

Shepherd exposes a single object onto the window, Shepherd.

That global object fires several events to let you link up actions with events occuring in any tour:

Methods

  • Shepherd.on(eventName, handler, [context]): Bind an event
  • Shepherd.off(eventName, [handler]): Unbind an event
  • Shepherd.once(eventName, handler, [context]): Bind just the next instance of an event

Events

The global Shepherd fires the following events whenever a Tour instance fires them. It adds to the object passed to the event handlers a tour key pointing to the instance which fired the event:

  • complete
  • cancel
  • hide
  • show
  • start
  • active
  • inactive

Current Tour

The global Shepherd includes a property which is always set to the currently active tour, or null if there is no active tour:

Shepherd