Webtour Widget for jQuery UI

The Webtour is a jQuery UI Widget that is designed to make it easy to add an interactive tour to your website pages. The interactive nature of the webtour improves user engagement and results in greater understanding by your users. These tours are showing up in more and more websites and range from very simple to very complex.

The webtour uses the jQuery UI dialog and position APIs to allow you to control the appearance and placement of each step in your tour. The webtour exposes a number of options and events that you can use to customize the tour for your site.

Dependencies

  • UI Core
  • UI Widget
  • UI Position
  • UI Dialog
  • UI Mouse (Optional; only needed if using UI Draggable or UI Resizable)
  • UI Draggable (Optional)
  • UI Resizable (Optional)

A webtour consists of multiple steps that are used to highlight different elements on the page. Each webtour step is displayed as a dialog box with navigation buttons and an optional arrow.

Using webtour events, you can control the underlying page to interact with page elements or even provide additional highlighting.

The webtour relies heavily on jQuery UI Dialogs for displaying the webtour content. Webtour provides complete control over the underlying dialogs. You can set global dialog options and provide options for each step in your tour.

Using webtour is as easy as making a call to $(container).webtour(); which creates a webtour step for every child element of the container. Typically this will involve the use of a div container with a number of child elements which represent the various webtour pages. This will create a series of dialogs that are centered on the screen.

The webtour uses a set of buttons for navigating through and ending the webtour.  If you close the webtour without pressing the "End Tour" button, then the webtour will resume where it left off the next time the tour is shown.  This feature only works if the user does not leave or refresh the current page.  If you want the webtour to remember the tour position across page refreshes, then you'll need to use the provided events to persist and restore the current webtour page.  By default, the current position in the tour is persisted and restored using the jQuery  data API which is reset if the page is refreshed.

Often though, you will want more control over how your webtour is displayed. You may even want to allow users to exit the tour and pick-up where the left off when they return to the page. The extensive list of options and events provide you the ability to customize the webtour to suit your needs.

  • autoStart

    Type:
    Boolean
    Default:
    true
  • prevButton

    Type:
    String
    Default:
    "Previous"
  • nextButton

    Type:
    String
    Default:
    "Next"
  • stopButton

    Type:
    String
    Default:
    "End Tour"
  • arrowTemplate

    Type:
    String
    Default:
    "<div />"
  • dialogOptions

    Type:
    Object
    Default:
    view defaults
  • pageOptions

    Type:
    Object
    Default:
    view defaults

The webtour plugin includes several different lifecycle events which provide you the ability to override standard behavior or to enhance the user experience. Following the jQuery UI standard, most events accept two parameters: event and ui. For all webtour events, the event parameter will be null. The ui parameter, where used, contains two properties: page and index.

The page property will be the jQuery object for the current webtour page (this is the object that is used when opening the dialog: page.dialog("open"); ). The index property denotes the position of the page in the original list of child elements for the container element used when creating the webtour: $("#container").webtour();

  • beforeShow

    Type:
    webtourbeforeshow
  • show

    Type:
    webtourshow
  • beforeHide

    Type:
    webtourbeforehide
  • hide

    Type:
    webtourhide
  • end

    Type:
    webtourend
  • loadActivePage

    Type:
    webtourloadactivepage
  • saveActivePage

    Type:
    webtoursaveactivepage

Coming Soon

The jQuery UI Webtour plugin uses a set of custom classes to provide the user control over the loook and feel of the webtour. These classes are in addition to the rich set of classes used by the jQuery UI Dialog plugin which forms the basis of the Webtour plugin.

Custom Webtour Classes

Page Classes

  • ui-webtour
  • ui-webtour-first
  • ui-webtour-last
  • ui-webtour-active

Button Classes

  • ui-webtour-buttonset
  • ui-webtour-button
  • ui-webtour-previous
  • ui-webtour-next
  • ui-webtour-end
  • ui-webtour-PrimaryAction
  • ui-webtour-SecondaryAction

Misc. Classes

  • ui-webtour-arrow

Below is an example of the markup rendered for a single step in the webtour. This sample is only provided to show how the webtour classes are used and does not represent the markup you use when creating your pages. For specific markup examples for creating a webtour please review the demonstration pages.

Sample markup with Webtour classes highlighted

<div class="ui-dialog ui-widget ui-widget-content ui-corner-all ui-draggable">
  <div class="ui-dialog-titlebar ui-widget-header ui-corner-all ui-helper-clearfix">
    <span id="ui-dialog-title-tour-1" class="ui-dialog-title">Step 1</span>
    <a class="ui-dialog-titlebar-close ui-corner-all" href="#"><span class="ui-icon ui-icon-closethick">close</span></a>
  </div>
  <div id="tour-1" class="ui-webtour-first ui-webtour ui-webtour-active ui-dialog-content ui-widget-content">
    Simple webtour.
  </div>
  <div class="ui-dialog-buttonpane ui-widget-content ui-helper-clearfix">
    <div class="ui-webtour-buttonset ui-dialog-buttonset">
      <button class="ui-webtour-button ui-webtour-PrimaryAction ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only">
        <span class="ui-button-text">Next</span>
      </button>
      <button class="ui-webtour-button ui-webtour-SecondaryAction ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only">
        <span class="ui-button-text">End Tour</span>
      </button>
    </div>
  </div>
</div>
<div class="ui-webtour-arrow"></div>

dummy