You might have encountered interactive demos created with screencasting and screengrabbing software that explain an interface to users in a step-by-step manner. This is exactly what this script does for web sites.
When you loaded this page and all went well you'll have seen the examples, download and first paragraph section being highlighted and a small panel with information showing up in succession. This is done with this script.
Step by Step uses the Yahoo User Interface library, and pulls in most of its dependencies automatically. What you need to include into the document though is the YUI loader and the main script:
<script src="http://yui.yahooapis.com/2.4.1/build/yuiloader/yuiloader-beta-min.js"></script>
<script src="stepbystep.js" charset="utf-8"></script>
All you need to do then is to write your Step by Step script. The good news is, it is not that hard to do. The bad news is that you need to understand JSON :)
So, what you need to do is write a JSON object in the following format and either embed it in a script tag (like it is on this page, check the source) or link to it as an external file (like all the example pages do).
Here's an example and below you find explanations about the different properties:
YAHOO.CH.stepByStepConfig = {
autostart:true,
autoplay:false,
delay:1000,
panelFade:true,
fadeSpeed:500,
nextLabel:'next >',
prevLabel:'< prev',
endLabel:'close',
cancelLabel:'close',
steps:[
{
id:'journey',
orientation:'tl-bl',
header:'Your checkout Journey',
body:'At any time of the process you can...',
width:'500px',
time:4000
},{
id:'billing',
orientation:'tl-tr',
header:'Your billing address',
body:'Enter your billing address',
width:'200px',
time:4000
}
]
};
The main configuration properties define the behaviour of the step-by-step show. You can either create a show that runs automatically like the one here or one that needs user input to go from step to step. You can determine the timing and the text in the links necessary to allow visitors to navigate from step to step. Furthermore you can create a show that smoothly fades the panels in and out or makes them appear immediately.
false, then you need to start the show manually by calling YAHOO.CH.stepByStep.start()autostart is true)autoplay is true)autoplay is true)autoplay is true)autoplay is true)The main show is defined in an array called steps with each step being an object. Step by Step goes through each of the array items in order and automatically creates the navigation necessary when the autoplay option is disabled. The different properties for each step are:
current-step. You can use this to style the element accordingly. Step by Step will automatically scroll the window to the element during the show.tr (top right), tl (top left), bl (bottom left) and br (bottom right). So if you want to align the bottom right corner of the panel with the top left corner of the element you'd use br-tl.Step by Step is copyright by Christian Heilmann and released under a Creative Commons 3.0 license. This means you can use and alter the script even for commercial use if you give me credit as the original author. The script is based on the YUI, which is copyright of Yahoo! and released under the BSD license.
Written by Chris Heilmann, some rights reserved (CC-BY)