<% @side_nav = "js" @joyride = true %>
<% @page_title = "Joyride" %>

<%= @page_title %>

Joyride is an extremely flexible plugin that gives users a tour of your site or app when they visit.

Some awesome part of your site!

Build Joyride with HTML

At the bottom of your page but inside of the body, place either an ol or ul with the data-joyride attribute. This list will contain all of the stops on your tour. To associate the tour stops with an item on your page, make sure the ID and data-id match between the two. If you do not associate an if, the tour stop will take on a modal style, positioning itself in the middle of the screen.

<%= code_example '
  1. Hello and welcome to the Joyride documentation page.

  2. Stop #1

    You can control all the details for you tour stop. Any valid HTML will work inside of Joyride.

  3. Stop #2

    Get the details right by styling Joyride with a custom stylesheet!

  4. Stop #4

    It works as a modal too!

', :html %>
We Add Some HTML with JS

To make Joyride really easy to use, we built its container and tour element inside the JS. This can make it hard to know what to target for styling purposes in some cases. To help this process go smoothly, here's what the output looks like with the appropriate classes to target for styling:

<%= code_example '

Hello and welcome to the Joyride documentation page.

Next ×
', :html %>

Available SCSS Variables

We've included a bunch of variables that you'll be able to use if you're into getting SASSy with things.

<%= code_example ' /* Controlling default Joyride styles */ $joyride-tip-bg: rgb(0,0,0); $joyride-tip-default-width: 300px; $joyride-tip-padding: emCalc(18px) emCalc(20px) emCalc(24px); $joyride-tip-border: solid 1px #555; $joyride-tip-radius: 4px; $joyride-tip-position-offset: 22px; /* Here, we are setting the tip dont styles */ $joyride-tip-font-color: #fff; $joyride-tip-font-size: emCalc(14px); $joyride-tip-header-weight: bold; /* This changes the nub size */ $joyride-tip-nub-size: 14px; /* This adjusts the styles for the timer when its enabled */ $joyride-tip-timer-width: 50px; $joyride-tip-timer-height: 3px; $joyride-tip-timer-color: #666; /* This changes up the styles for the close button */ $joyride-tip-close-color: #777; $joyride-tip-close-size: 30px; $joyride-tip-close-weight: normal; /* When Joyride is filling the screen, we use this style for the bg */ $joyride-screenfill: rgba(0,0,0,0.5); ', :css %>

Using the JavaScript

You'll need to include abstractio.joyride.js to get plugin to work. You'll also need to make sure to include zepto.js and abstractio.js above the alert plugin. Above your closing </body> tag include the following line of code and make sure you have the JS in your directory.

Read how to install Abstractio JavaScript

Required Abstractio Library: abstractio.joyride.js, Optional JS Library: abstractio.cookie.js

Joyride does not initialize on page load like the rest of the plugins. You need to call start to get it to load.

<%= code_example ' ', :html %>

Then, you'll need to add a data-joyride to make the JS work properly on that element. It looks something like this:

<%= code_example '
    ...
', :html %>
Optional JavaScript Configuration

You can either set these options in a data-options attribute in the markup, data-options="option: value; option2: value syntax", or pass in on initialization. Configurations that are objects, functions, or arrays can only be passed in during intitialization.

<%= code_example " { tipLocation : 'bottom', // 'top' or 'bottom' in relation to parent nubPosition : 'auto', // override on a per tooltip bases scrollSpeed : 300, // Page scrolling speed in milliseconds timer : 0, // 0 = no timer , all other numbers = timer in milliseconds startTimerOnClick : true, // true or false - true requires clicking the first button start the timer startOffset : 0, // the index of the tooltip you want to start on (index of the li) nextButton : true, // true or false to control whether a next button is used tipAnimation : 'fade', // 'pop' or 'fade' in each tip pauseAfter : [], // array of indexes where to pause the tour after tipAnimationFadeSpeed: 300, // when tipAnimation = 'fade' this is speed in milliseconds for the transition cookieMonster : false, // true or false to control whether cookies are used cookieName : 'joyride', // Name the cookie you'll use cookieDomain : false, // Will this cookie be attached to a domain, ie. '.notableapp.com' cookieExpires : 365, // set when you would like the cookie to expire. tipContainer : 'body', // Where will the tip be attached postRideCallback : function (){}, // A method to call once the tour closes (canceled or complete) postStepCallback : function (){}, // A method to call after each step template : { // HTML segments for tip layout link : '×', timer : '
', tip : '
', wrapper : '
', button : '' } }", :js %>
<%= render "_sidebar-components.html.erb" %>
  1. Hello and welcome to the Joyride documentation page.

  2. Stop #1

    You can control all the details for you tour stop. Any valid HTML will work inside of Joyride.

  3. Stop #2

    Get the details right by styling Joyride with a custom stylesheet!

  4. Stop #4

    It works as a modal too!