forked from sorich87/bootstrap-tour
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
77 lines (74 loc) · 2.14 KB
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
$(function() {
var $start = $('.start'),
tour = new Tour({
onStart: function() {
$start.hide();
},
onEnd: function() {
$start.show();
}
});
tour.addStep({
element: '#overview',
placement: "bottom",
title: "Welcome to Bootstrap Tour!",
content: "Introduce new users to your product by walking them " +
"through it step by step. Built on the awesome " +
"<a href='http://twitter.github.com/bootstrap' target='_blank'>" +
"Bootstrap from Twitter.<\/a>"
});
tour.addStep({
element: "#usage",
placement: "right",
title: "Setup in four easy steps",
content: "Easy is better, right? Easy like Bootstrap.",
options: {
labels: {prev: "Go back", next: "Hey", end: "Stop"}
}
});
tour.addStep({
path: "/",
element: "#options",
placement: "right",
title: "And it is powerful!",
content: "There are more options for those, like us, who want to do " +
"complicated things. <br \/>Power to the people! :P",
reflex: true
});
tour.addStep({
path: "/",
element: "#reflex-mode",
placement: "bottom",
title: "Reflex mode",
content: "Reflex mode is enabled, click on the page heading to continue!",
reflex: true
});
tour.addStep({
path: "/page.html",
element: "h1",
placement: "bottom",
title: "See, you are not restricted to only one page",
content: "Well, nothing to see here. Click next to go back " +
"to the index page."
});
tour.addStep({
path: "/",
element: "#contributing",
placement: "right",
title: "Best of all, it's free!",
content: "Yeah! Free as in beer... or speech. Use and abuse, " +
"but don't forget to contribute!"
});
tour.start();
if (tour.ended()) {
$('<div class="alert">' +
'<button class="close" data-dismiss="alert">×</button>' +
'You ended the demo tour. <a href="#" class="start">Restart the demo tour.</a>' +
'</div>').prependTo('.content').alert();
}
$(document).on('click', '.start', function(e) {
e.preventDefault();
tour.restart();
$('.alert').alert('close');
});
});