Joyride
Create jQuery Feature Tours in a Breeze
Setting up Joyride is simple, just attach the needed files, drop in your markup and choose your settings.
Joyride is extremely flexible and lets you take control of how people interact with your tour. We programmed it to be cross-browser compatible with modern browsers and even used some fancy CSS to avoid images. Now let’s see just how easy it is to take your first ride without getting the fuzz involved.
Step 1
Pack Your Bags
You’ll definitely need the Joyride kit in order to do this, so make sure you download it. Just add the following markup to your document <head> and you’ll have everything you need to start your Joyride.
/* Attach the Joyride CSS file */ <link rel=" stylesheet" type="text/css" href="stylesheets/app.css"> /* jQuery needs to be attached */ <script src="jquery-1.6.2.min.js" type="text/javascript"></script> /* Then attach the Joyride plugin */ <script src="jquery.joyride.js" type="text/javascript"></script>
Step 2
Define Your Tour Stops
Joyride will work with any element in your markup, the only requirement is that the element must have a unique id to tell the joyride plugin it is a stop of the tour. You will use the id of each "stop" when you create your tour outline in the next step.
/* Joyride can be attached to any element with a unique ID, in any order */ <h3 id="yourHeaderID"></h3> <p id="yourParagraphID"> <a id="yourAnchorID" href="#url">
Step 3
Create Your Tour Outline
Create an outline list of your tour stops in a <ol> element and be sure to give that an id of your choice. You'll need to add this id into the options a little later. For each stop of the tour add an <li> element with a "data-id" attribute. The value of the data-id attribute should be the ID of the html element you want as the stop. This <ol> element should be placed right before you close the body of your markup.
There are some options to consider when creating the steps of your tour. First, you can control the text of each button in the tour. To do this, simply add "data-text" to your <li> and type out what the button should say. Second, you can add custom classes to any or all of the <li>’s. This enables you to control each step with complete granularity.
/* Each tip is set within this <ol>. */ /* This creates the order the tips are displayed */ <ol id="chooseID"> /* data-id needs to be the same as the parent it will attach to */ <li data-id="newHeader">Tip content...</li> /* using 'data-text' lets you have custom button text */ <li data-id="parentElementID" data-text="Second Button">Content...</li> /* you can put a class for custom styling */ <li data-id="parentElementID" class="custom-class">Content...</li> </ol>
Step 4
Start the Engine
To make sure your Joyride goes smoothly, start the engines by including the above code before the closing </body> element of your page. There are also a handful of options that you can set to customize the experience for your passengers.
/* Launching joyride when to page is loaded */ <script type="text/javascript"> $(window).load(function() { $(this).joyride({ /* Options will go here */ }); }); </script>
Step 5
Options and Upgrades
These options will let you control how people interact with Joyride.
/* Setting your options to override the defaults */ $(this).joyride({ 'tipLocation': 'bottom', // 'top' or 'bottom' in relation to parent 'scrollSpeed': 300, // Page scrolling speed in ms 'timer': 2000, // 0 = off, all other numbers = time(ms) 'startTimerOnClick': true, // true/false to start timer on first click 'nextButton': true, // true/false for next button visibility 'tipAnimation': 'pop', // 'pop' or 'fade' in each tip 'tipAnimationFadeSpeed': 300, // if 'fade'- speed in ms of transition 'cookieMonster': true, // true/false for whether cookies are used 'cookieName': JoyRide, // choose your own cookie name 'cookieDomain': false, // set to false or yoursite.com 'tipContainer': body, // Where the tip be attached if not inline 'inline': false, // true/false for inline positioning 'tipContent': #joyRideContent, // The ID of the <ol> used for content 'postRideCallback': null // a method to call once the tour closes });
Enjoy Your Ride
Now that you know how to use Joyride, you can show off all your awesome features in style. Download the kit to get stared today! If you have any questions or find a bug feel free to let us know by leaving a comment on the Joyride blog post or visiting the Joyride GitHub page to log your issues.
This plugin is licensed to use and abuse under the MIT license!
Download
The Joyride Kit includes the necessary JS + CSS, but also a demo HTML page that shows off how to hookup your first tour using different options.
Download the Joyride KitAvailable on GitHub
We've put Joyride on GitHub to make handling code maintenance and issue tracking as easy as possible. Or you can pop it open right in GitHub for Mac, here »
Thoughts?
Ride on over to the blog post about Joyride to see what others are saying or to let us know what you think.
-
Joyride gives you everything you need to call out new features in your app or website.
-
Get it running in 5 simple steps.
-
Feel free to use the plugin however you want, it's covered under the MIT license!
-
Grab this kit and start using it in your own projects!
-
Feel like contributing? Get on over to GitHub and do your thing.
-
About the Car
The 1962 Studebaker Lark was made in hopes that it would save America's oldest vehicle manufacturer when it was launched in the fall of 1958.
Want to see what this baby can do? Try typing in the Konami code to hear the engines roar!
