forked from EragonJ/Trip.js
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
380 lines (380 loc) · 15.7 KB
/
index.html
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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
<!DOCTYPE html>
<!--if lt IE 7html.no-js.lt-ie9.lt-ie8.lt-ie7(lang='en')
-->
<!--if IE 7html.no-js.lt-ie9.lt-ie8(lang='en')
-->
<!--if IE 8html.no-js.lt-ie9(lang='en')
-->
<!--[if gt IE 8]><!-->
<html lang="en" class="no-js">
<!--<![endif]-->
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>Trip.js </title>
<meta name="description" content="Trip.js is a plugin that can help you customize a tutorial trip easily with more flexibilities. (Based on jQuery)">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta property="og:image" content="http://eragonj.github.io/Trip.js/public/img/logo-tiny.png">
<!-- styles-->
<link rel="stylesheet" href="public/vendor/bootstrap/css/bootstrap.min.css">
<link rel="stylesheet" href="public/vendor/bootstrap/css/bootstrap-responsive.min.css">
<link rel="stylesheet" href="public/vendor/highlight/github.min.css">
<link rel="stylesheet" href="public/css/base.css">
<link rel="stylesheet" href="public/css/responsive.css">
<link rel="stylesheet" href="src/trip.min.css">
<!-- 3rd parties -->
<script src="public/vendor/highlight/highlight.min.js"></script>
<script src="public/vendor/modernizr-2.6.2.min.js"></script>
<script src="public/vendor/jquery-1.8.3.min.js"></script>
<script src="public/vendor/bootstrap/js/bootstrap.min.js"></script>
<script src="public/js/global.js"></script>
<!-- tracking stuffs-->
<script src="public/vendor/social/ga.js"></script>
<script src="public/vendor/social/fb.js"></script>
<script src="public/vendor/social/twitter.js"></script>
<!-- include trip-->
<script src="src/trip.js"></script>
<link rel="stylesheet" href="public/css/index.css">
<script src="public/js/demo-index.js"></script>
</head>
<body>
<div id="fb-root"></div><a id="fork-button" href="https://github.com/EragonJ/Trip.js"><img style="position: absolute; top: 0; right: 0; border: 0;" src="https://s3.amazonaws.com/github/ribbons/forkme_right_gray_6d6d6d.png" alt="Fork me on GitHub"></a>
<div class="container">
<div class="navbar">
<div class="navbar-inner"><a href="#" class="brand demo-index step1">Trip.js</a>
<ul class="nav">
<li><a href="index.html">Home</a></li>
<li><a href="demo-basic.html">Demos</a></li>
<li><a href="https://github.com/EragonJ/Trip.js/tags">Download</a></li>
<li><a href="https://github.com/EragonJ/Trip.js/contributors">Contributors</a></li>
<li><a href="https://github.com/EragonJ/Trip.js">Github</a></li>
</ul>
<ul class="nav pull-right">
<li><a href="http://github.com/EragonJ">By EragonJ</a></li>
</ul>
</div>
</div>
<div class="jumbotron"><img src="public/img/logo-tiny.png" class="demo-basic-1 demo-basic-2 step1 step2 step3 step4"></div>
<div class="social-buttons clearfix">
<div data-href="http://eragonj.github.com/Trip.js/" data-layout="button_count" data-width="450" data-show-faces="false" data-send="false" class="fb-like"></div>
<div class="twitter"><a href="https://twitter.com/share" data-hashtags="trip.js" class="twitter-share-button">Tweet</a></div>
<div class="github">
<iframe src="http://ghbtns.com/github-btn.html?user=EragonJ&repo=Trip.js&type=watch&count=true" allowtransparency="true" frameborder="0" scrolling="0" width="152" height="20"></iframe>
</div>
</div>
<div class="text-center">
<input type="button" value="Show Me a Quick Demo" class="start-demo-index btn btn-success btn-large">
</div>
<div class="steps">
<div class="step">
<h2><span class="demo-index step2">What is Trip.js ?</span></h2>
<p>Trip.js is a plugin that can help you customize a tutorial trip easily with more flexibilities. ( Based on jQuery ) </p>
</div>
<div class="step">
<h2>Version</h2>
<p>1.3.0</p>
</div>
<div class="step">
<h2>Setup ( Minimal )</h2>
<ol>
<li>Include your jQuery
<script src="https://gist.github.com/EragonJ/5855718.js"></script>
</li>
<li>Include src/trip.css
<script src="https://gist.github.com/EragonJ/5855723.js"></script>
</li>
<li>Include src/trip.js
<script src="https://gist.github.com/EragonJ/5855736.js"></script>
</li>
<li class="demo-index step3 step4 step5 step6">Setup Trip.js
<script src="https://gist.github.com/EragonJ/5855739.js"></script>
</li>
<li class="demo-index step7">Take a Trip Now !
<script src="https://gist.github.com/EragonJ/5855742.js" class="step7"></script>
</li>
</ol>
</div>
<div class="step">
<h2>Global Options</h2>
<ol>
<li>
<h4>tripIndex</h4>
<p>You can set tripIndex ( start from 0 ) to specific trip block at start.</p>
<p>Default : <code>0</code></p>
</li>
<li>
<h4>tripTheme </h4>
<p>You can set which theme to use, now have white and black two themes.</p>
<p>Default : <code>black</code></p>
</li>
<li>
<h4>backToTopWhenEnded</h4>
<p>You can ask Trip.js go back to top when ended.</p>
<p>Default : <code>false</code></p>
</li>
<li>
<h4>overlayZindex</h4>
<p>You can set the basic zIndex for overlay if you want to expose elements.</p>
<p>Default : <code>99999</code></p>
</li>
<li>
<h4>enableKeyBinding</h4>
<p>You can decide to bind key events for trip navigations or not.</p>
<p>Default : <code>true</code></p>
</li>
<li>
<h4>enableAnimation</h4>
<p>You can enable animations on tripBlock.</p>
<p>Default : <code>true</code></p>
</li>
<li>
<h4>showCloseBox</h4>
<p>You can decide to add small close icon on each trip or not</p>
<p>Default : <code>false</code></p>
</li>
<li>
<h4>skipUndefinedTrip</h4>
<p>You can enable this option to tell Trip.js skip undefined trips ( Undefined trips mean the trips without content or without sel or can not be selected by jQuery ). </p>
<p>Default : <code>false</code></p>
</li>
<li>
<h4>delay</h4>
<p>every trip will be lived for 1 second (1000 ms) by default</p>
<p>Setting to a <code>-1</code> will prevent auto-advancing. You must manually call <code>trip.next()</code>.</p>
<p>Default : <code>1000</code></p>
</li>
<li>
<h4>showNavigation</h4>
<p>Toggle navigation buttons</p>
<p>Default : <code>false</code></p>
</li>
<li>
<h4>prevLabel</h4>
<p>Label for the previous button.</p>
<p>Default : <code>Back</code></p>
</li>
<li>
<h4>nextLabel</h4>
<p>Label for the next button.</p>
<p>Default : <code>Next</code></p>
</li>
<li>
<h4>finishLabel</h4>
<p>Label for the finish button.</p>
<p>Default : <code>Dismiss</code></p>
</li>
<li>
<h4>animation</h4>
<p>Animation that would be applied on the tripBlock.</p>
<p>Default : <code>tada</code></p>
</li>
<li>
<h4>canGoPrev</h4>
<p>
Determines if the user can go backwards. If set to a function
it is called and the response is evaluated.
</p>
<p>Default : <code>true</code></p>
</li>
<li>
<h4>canGoNext</h4>
<p>
Determines if the user can go forward. If set to a function
it is called and the response is evaluated.
</p>
<p>Default : <code>true</code></p>
</li>
<li>
<h4>onTripStart()</h4>
<p>You can set a callback function triggered when Trip.js starts.</p>
<p>Default : <code>$.noop</code></p>
</li>
<li>
<h4>onTripEnd()</h4>
<p>You can set a callback function triggered when Trip.js ends.</p>
<p>Default : <code>$.noop</code></p>
</li>
<li>
<h4>onTripStop()</h4>
<p>You can set a callback function triggered when Trip.js stops.</p>
<p>Default : <code>$.noop</code></p>
</li>
<li>
<h4>onTripPause(tripIndex, tripObject)</h4>
<p>You can set a callback function triggered when the Trip.js pauses. tripObject is your passed JSON for this current trip, and tripIndex is the current step index when the trip was paused. You can add your customized functions in your object and call them when Trip.js is paused.</p>
<p>Default : <code>$.noop</code></p>
</li>
<li>
<h4>onTripChange(tripIndex, tripObject)</h4>
<p>You can set a callback function triggered when Trip.js changes to another step. tripObject is your passed JSON for this current trip, so you can add your customized functions in your object and call the function when Trip.js changes to this step.</p>
<p>Default : <code>$.noop</code></p>
</li>
</ol>
</div>
<div class="step">
<h2>Local Options </h2>
<h4>You can setup specific options for each step.</h4>
<ol>
<li>
<h4>sel</h4>
<p>Which selector is referenced in this step.</p>
<p>Default : <code>no default</code></p>
</li>
<li>
<h4>content *Required*</h4>
<p>What information that you want to show to users.</p>
<p>Default : <code>no default</code></p>
</li>
<li>
<h4>position</h4>
<p>What position would you prefer for the tripBlock. We support 9 different positions : e, w, n, s, screen-ne, screen-se, screen-sw, screen-nw, screen-center.</p>
<p>To be clear, e, w, n, s are related to the sel, so for this use case, sel is required. For screen-ne, screen-se, screen-sw, screen-nw and screen-center are related to the screen (fixed in CSS), so in this case, you don't have to put sel.</p>
<p>Default : <code>n</code>( You can use e, w, n, s, screen-ne, screen-se, screen-sw, screen-nw, screen-center 9 positions )</p>
</li>
<li>
<h4>delay</h4>
<p>
You can delay longer / shoter for this step. You can assign
<code>delay</code>
in global options to change the default delay.
Setting to a
<code>-1</code>
will prevent auto-advancing. You must manually call
<code>trip.next()</code>
.
</p>
<p>Default : <code>1000</code></p>
</li>
<li>
<h4>callback</h4>
<p>
You can do whatever you want to do after this step passed. BTW, Trip.js will assign the current
<code>tripIndex</code>
(start from 0) as the first parameter back to your callback function for later use.
</p>
<p>Default : <code>$.noop</code></p>
</li>
<li>
<h4>expose</h4>
<p>You can enable this option to expose your selected element in this trip.</p>
<p>Default : <code>false</code></p>
</li>
<li>
<h4>showNavigation</h4>
<p>Toggle navigation buttons</p>
<p>Default : <code>false</code></p>
</li>
<li>
<h4>showCloseBox</h4>
<p>You can decide to add small close icon on each trip or not</p>
<p>Default : <code>false</code></p>
</li>
<li>
<h4>prevLabel</h4>
<p>Label for the previous button.</p>
<p>Default : <code>Back</code></p>
</li>
<li>
<h4>nextLabel</h4>
<p>Label for the next button.</p>
<p>Default : <code>Next</code></p>
</li>
<li>
<h4>finishLabel</h4>
<p>Label for the finish button.</p>
<p>Default : <code>Dismiss</code></p>
</li>
<li>
<h4>tripBlockHTML</h4>
<p>Base HTML for tripBlock</p>
<p>Default : <code>An array contains base HTML of tripBlock</code></p>
</li>
<li>
<h4>canGoPrev</h4>
<p>
Determines if the user can go forward. If set to a function
it is called and the response is evaluated.
</p>
<p>Default : <code>true</code></p>
</li>
<li>
<h4>canGoNext</h4>
<p>
Determines if the user can go forward. If set to a function
it is called and the response is evaluated.
</p>
<p>Default : <code>true</code></p>
</li>
<li>
<h4>animation</h4>
<p>
Animation that would be applied on the tripBlock. if ignored,
global value would be used.
</p>
<p>Default : <code>tada</code></p>
</li>
</ol>
</div>
<div class="step">
<h2>Key Binding</h2>
<ol>
<li>
<h4>Right and Down arrows</h4>
<p>Go to next trip</p>
</li>
<li>
<h4>Left and Up arrows</h4>
<p>Go back to previous trip</p>
</li>
<li>
<h4>Space</h4>
<p>pause / resume</p>
</li>
<li>
<h4>Esc</h4>
<p>Stop</p>
</li>
</ol>
</div>
<div class="step">
<h2>API</h2>
<ol>
<li>
<h4>trip.start()</h4>
<p>Call this method to start your trip</p>
</li>
<li>
<h4>trip.stop()</h4>
<p>Call this method to stop your trip</p>
</li>
<li>
<h4>trip.pause()</h4>
<p>Call this method to pause your trip (same as trip.resume)</p>
</li>
<li>
<h4>trip.resume()</h4>
<p>Call this method to continue your trip (same as trip.pause)</p>
</li>
<li>
<h4>trip.next()</h4>
<p>jump to next step</p>
</li>
<li>
<h4>trip.prev()</h4>
<p>jump back to previous step</p>
</li>
</ol>
</div>
<div class="step demo-index step8">
<h2>Notice</h2>
<p>
This plugin is still under development !
If you find any bugs or want me to implement anything,
please feel free to open an issue ;)
</p>
<p><a href="https://github.com/EragonJ/Trip.js/issues">Open an issue</a></p>
</div>
</div>
</div>
</body>
</html>