% @side_nav = "js" @joyride = true %>
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.
Hello and welcome to the Joyride documentation page.
You can control all the details for you tour stop. Any valid HTML will work inside of Joyride.
Get the details right by styling Joyride with a custom stylesheet!
It works as a modal too!
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 ' ', :html %>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 %>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.
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 '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.
Hello and welcome to the Joyride documentation page.
You can control all the details for you tour stop. Any valid HTML will work inside of Joyride.
Get the details right by styling Joyride with a custom stylesheet!
It works as a modal too!