forked from EragonJ/Trip.js
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdoc-api.html
More file actions
124 lines (113 loc) · 5.9 KB
/
doc-api.html
File metadata and controls
124 lines (113 loc) · 5.9 KB
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
<!DOCTYPE html>
<html lang="en">
<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.">
<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="//maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.2/css/bootstrap.min.css">
<link rel="stylesheet" href="public/vendor/highlight/github.min.css">
<link rel="stylesheet" href="public/css/index.css">
<link rel="stylesheet" href="dist/trip.min.css">
<!-- 3rd parties -->
<script src="public/vendor/highlight/highlight.min.js"></script>
<script src="https://code.jquery.com/jquery-1.11.2.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.2/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="dist/trip.js"></script>
<script src="public/js/demo-index.js"></script>
<link rel="stylesheet" href="public/vendor/github-markdown-css/github-markdown.css">
</head>
<body>
<div id="fb-root"></div>
<a class="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 main-container">
<nav class="navbar navbar-default main-navbar">
<div class="container-fluid">
<div class="navbar-header">
<a class="navbar-brand" href="#">Trip.js</a>
</div>
<div class="collapse navbar-collapse">
<ul class="nav navbar-nav">
<li><a href="index.html">Home</a></li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">Documentations <span class="caret"></span></a>
<ul class="dropdown-menu" role="menu">
<li><a href="doc-setup.html">Setup</a></li>
<li><a href="doc-configuration.html">Configuration</a></li>
<li><a href="doc-api.html">API</a></li>
<li class="divider"></li>
<li><a href="doc/jsdoc/index.html">JSDoc for Source code</a></li>
</ul>
</li>
<li><a href="demo.html">Demo</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 navbar-nav navbar-right">
<li><a href="http://github.com/EragonJ">By EragonJ</a></li>
</ul>
</div>
</div>
</nav>
<div class="logo-container">
<img src="public/img/logo-tiny.png" class="demo-basic-1 demo-basic-2 step1 step2 step3 step4">
</div>
<div class="social-buttons-container">
<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="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 class="twitter"><a data-url="http://eragonj.github.io/Trip.js" href="https://twitter.com/share" data-hashtags="trip.js" class="twitter-share-button">Tweet</a></div>
</div>
</div>
<div class="markdown-body">
<h1 id="key-bindings">Key Bindings</h1>
<p>Trip.js would detect following keys to do relative actions after loading it.</p>
<ul>
<li>Right and Down arrows - Go to next trip</li>
<li>Left and Up arrows - Go back to previous trip</li>
<li>Space - pause / resume trip</li>
<li>Esc - Stop trip</li>
</ul>
<h1 id="api">API</h1>
<ul>
<li><code>trip.start()</code></li>
<li><code>trip.stop()</code></li>
<li><code>trip.pause()</code></li>
<li><code>trip.resume()</code></li>
<li><code>trip.next()</code></li>
<li><code>trip.prev()</code></li>
</ul>
<h2 id="introductions">Introductions</h2>
<p>When using Trip.js, after initializing, you will get a <code>trip</code> object that has several APIs that you can use with in different situation. And here comes an example : </p>
<pre><code class="lang-javascript"><span class="hljs-keyword">var</span> trip = <span class="hljs-keyword">new</span> Trip([...]);
</code></pre>
<h3 id="trip-start-">trip.start()</h3>
<p>This is the entry point that to start the whole predefined trip.</p>
<h3 id="trip-stop-">trip.stop()</h3>
<p>This will finish the whole trip in time.</p>
<h3 id="trip-pause-">trip.pause()</h3>
<p>Sometimes, you may need to pause the trip for a while to let users do something, then, you can use this.</p>
<h3 id="trip-resume-">trip.resume()</h3>
<p>After a while, you want to make the paused trip back to work, you will need this one. But even if <code>trip.pause()</code> and <code>trip.resume()</code> sounds different, the implementation behind them are the same, so you can just treat them as same function but with different name.</p>
<h3 id="trip-next-">trip.next()</h3>
<p>Jump to the next step.</p>
<h3 id="trip-prev-">trip.prev()</h3>
<p>Jump back to previous step.</p>
</div>
</body>
</html>