Guides.js is a lightweight javascript library for making guided website tours. It finds the element you want to highlight, creates a guide element using the html you specified in the configuration options and connects the guide and the highlighted element with an svg arrow.
<h1>Guides.js <small>lightweight javascript library for making guided website tours</small></h1>
</div>
<p>Guides.js finds the element you want to highlight, creates a guide element using the html you specified in the configuration options and connects the guide and the highlighted element with an svg arrow.</p>
<p>Note that you can import <em>guides.scss</em> and compile it togerther with your website styles if you are using sass.</p>
</section>
<h3id="docs">Docs</h3>
<section>
<h4>Dependencies</h4>
<p><em>Guides.js</em> depends on <b>jquery</b>, so you need to make sure you include jquery first.</p>
<h4>Initialization</h4>
<p><em>Guides.js</em> is a jquery plugin and it can be initialized on an element, that will "trigger" the guided tour:</p>
<p><pre>
$('#demo').guides({
guides: [{
element: $('.navbar-brand'),
html: 'Welcome to Guides.js'
}, {
element: $('.navbar'),
html: 'Navigate through guides.js website'
}, {
element: $('#demo'),
html: 'See how it works'
}, {
element: $('#download'),
html: 'Download guides.js'
}, {
element: $('#getting-started'),
html: 'Check out how to get started with guides.js'
}, {
element: $('#docs'),
html: 'Read the docs'
}]
});</pre></p>
<p>Now the tour will start everytime <kbd>$('#demo')</kbd> element is clicked.</p>
<p>If you want to manually start the tour you can do the following:</p>
<p><pre>
var guides = $.guides({
guides: [{
html: 'Welcome to Guides.js'
}, {
element: $('.navbar'),
html: 'Navigate through guides.js website'
}, {
element: $('#demo'),
html: 'See how it works'
}, {
element: $('#download'),
html: 'Download guides.js'
}, {
element: $('#getting-started'),
html: 'Check out how to get started with guides.js'
}, {
element: $('#docs'),
html: 'Read the docs'
}]
});
guides.start();
</pre></p>
<h4>Configuration options</h4>
<h5>The default options are as follows:</h5>
<p><pre>
{
distance: 100,
color: '#fffff',
guides: []
}</pre></p>
<dlclass="dl-horizontal">
<dt>distance</dt>
<dd><em>number</em> - distance between the guide text and the element that it is related to.</dd>
<dt>color</dt>
<dd><em>string</em> - arrows and text default color</dd>
<dt>guides</dt>
<dd><em>array of objects</em> - the list of guides</dd>
</dl>
<h5>The guides array</h5>
<p>A guide object looks like this:</p>
<pre>{
element: $('.navbar-brand'),
html: 'Welcome to Guides.js',
color: '#fff'
}</pre>
<dlclass="dl-horizontal">
<dt>element</dt>
<dd><spanclass="label label-default">optional</span><em>jquery element or string</em> - the element (or selector) you want to highlight; if omitted the guide will be centered</dd>
<dt>html</dt>
<dd><spanclass="label label-danger">required</span><em>string</em> - this is the content of the tip: you can enter plain text or markup</dd>
<dt>color</dt>
<dd><spanclass="label label-default">optional</span><em>string</em> - arrow and text color (falls back to the default color if not specified)</dd>
<dt>render</dt>
<dd><spanclass="label label-default">optional</span><em>function</em> - a callback function that is called before guide is rendered</dd>
</dl>
<h4>Methods</h4>
<dlclass="dl-horizontal">
<dt>start</dt>
<dd><kbd>$('#demo').guides('start');</kbd> Starts the guided tour.</dd>
<dt>end</dt>
<dd><kbd>$('#demo').guides('end');</kbd> Exits the guided tour.</dd>
<dt>next</dt>
<dd><kbd>$('#demo').guides('next');</kbd> Moves to the next guide.</dd>
<dt>prev</dt>
<dd><kbd>$('#demo').guides('prev');</kbd> Moves back to the previous guide.</dd>
<dt>destroy</dt>
<dd><kbd>$('#demo').guides('destroy');</kbd> Exits the guided tour and destroys it.</dd>
<dt>setOptions</dt>
<dd><kbd>$('#demo').guides('setOptions', options);</kbd> Extends the guides configuration options with the options sent as a second parameter.</dd>
</dl>
<h4>Events</h4>
<dlclass="dl-horizontal">
<dt>start</dt>
<dd><kbd>$('#demo').guides({start: onStartFunction});</kbd> Called after the tour starts.</dd>
<dt>end</dt>
<dd><kbd>$('#demo').guides({end: onEndFunction});</kbd> Called after the tour ends.</dd>
<dt>next</dt>
<dd><kbd>$('#demo').guides({next: onNextFunction});</kbd> Called after showing the next guide.</dd>
<dt>prev</dt>
<dd><kbd>$('#demo').guides({prev: onPrevFunction});</kbd> Called after showing the previous guide.</dd>
<dt>render</dt>
<dd><kbd>$('#demo').guides({render: onRenderFunction});</kbd> Called before a guide is rendered.</dd>
<dt>destroy</dt>
<dd><kbd>$('#demo').guides({destroy: onDestroyFunction});</kbd> Called after destroying.</dd>
</dl>
</section>
<h3id="download">Download</h3>
<section>
The source is availabe on github: <ahref="https://github.com/epetrova/guides/">https://github.com/epetrova/guides/</a>: