-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathindex.html
352 lines (316 loc) · 16.3 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
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<title>jQuery Tutorial Plugin | Particle Bits</title>
<style type="text/css" media="all">
* { padding: 0; margin: 0; }
html { height: 100%; }
body { font-family:"Trebuchet MS",Helvetica,Jamrul,sans-serif; font-size:16px; background-color:#eee; }
a { color:#6695E2; text-decoration:none; border-bottom:1px solid #ddd; }
a:hover { border-bottom:1px solid #ccc; background-color:#D0E2FF; color:#2C5FB2; }
code { background-color: #000000; color: #FFFFFF; padding:2px 3px; font-size:14px; position:relative; top:-1px; }
h1 { font-weight:normal; font-size:28px; padding:6px 12px; margin-bottom:15px; background-color: #D0E2FF; }
p { line-height:150%; color:#333; }
xmp { background-color: #000000; color: #FFFFFF; font-size: 14px; margin: 15px 20px; padding:18px; }
#stage { width:960px; border:1px solid #ddd; padding:15px; margin:40px auto 20px; background-color: #FFFFFF; }
#header { padding-bottom:15px; border-bottom:1px solid #ddd; margin-bottom:15px; }
#header p { margin-bottom:10px; }
#start { margin:15px 30px; padding:6px 12px; font-size:22px; color:#fff; background-color:#000; border:none;
cursor:pointer; }
#content .section { margin-bottom:20px; border-bottom:1px solid #eee; padding-bottom:20px; }
#content h2 { font-weight:normal; font-size:22px; margin-bottom:10px; padding:5px 10px; background-color:#EAF2FF; }
#content h3 { font-size:16px; margin-bottom:5px; }
#content .return { margin-top:40px; }
#content p.padded { margin-bottom:15px; }
#content ul { margin:10px 40px 25px; }
#content ul strong.label { float:left; display:block; width:40px; }
#content ul li { margin-bottom:5px; }
#footer { color: #999999; font-size: 13px; margin: 0 auto; padding: 10px 0 30px; text-shadow: 0 1px 0 #FFFFFF;
width: 960px; }
.centered { text-align:center; }
.round { -moz-border-radius:4px; -webkit-border-radius:4px; border-radius:4px; }
.rounder { -moz-border-radius:6px; -webkit-border-radius:6px; border-radius:6px; }
</style>
<link href="css/jquery.tutorial.css" rel="stylesheet" type="text/css" media="screen" />
<link href="css/prettify.css" rel="stylesheet" type="text/css" media="screen" />
<script src="js/lib/jquery.1.6.2.min.js" type="text/javascript"></script>
<script src="js/prettify.js" type="text/javascript"></script>
<script src="js/jquery.tutorial.js" type="text/javascript"></script>
<script type="text/javascript">
// load the tutorial when the document is ready
//
$(document).ready( function() {
// calling this will start and display the tutorial.
//
// possible options include:
// location: tl, tr, bl, br for top left, top right, bottom left, and bottom right.
// defaults to 'tl'.
// width: integer in pixels, defaults to 320px.
// opactiy: decimal from 0 to 1 with 1 being opaque. defaults to 0.4.
// returnTop: boolean for returning to top of page when the tutorial is over.
//
$('#start').click( function() {
options = {
location: 'tl',
width: 320,
opacity: 0.4,
returnTop: true
};
$('#tutorial').tutorial( options );
});
// call the pretty print script
//
prettyPrint();
});
</script>
<meta name="author" content="Mike Gioia" />
<meta charset="UTF-8" />
<meta name="description" content="jQuery Site Toturial Plugin" />
<meta name="keywords" content="jQuery Tutorial, jQuery Site Tutorial, Tutorial Plugin, Tutorial jQuery, Site Tutorial" />
</head>
<body>
<div id="stage" class="rounder">
<a name="top"></a>
<div id="header">
<h1 class="round">jQuery Tutorial Plugin</h1>
<p>
This plugin displays a very clean and simple tutorial flow for any web page. All you need to do is set up your
markup correctly and you're good to go. To initialize it, just call the following on your tutorial element in your
HTML: <code>$('#tutorial').tutorial();</code>
</p>
<div class="centered">
<input type="button" id="start" class="round" value="Start Demo" />
</div>
</div><!-- /header -->
<div id="content">
<div class="section">
<h2 class="round">Include the Script and Stylesheet</h2>
<p>
There's 1 stylesheet and 1 javascript file that you need to include on any page displaying the tutorial. Also,
please copy the images folder 'tutorial' to the same directory that your jquery.tutorial.css file is in. If you
would like to move the location of these images, then please update the jquery.tutorial.css image paths
appropriately.
</p>
<pre class="prettyprint" id="includes">
<link href="css/jquery.tutorial.css" rel="stylesheet" type="text/css" media="screen" />
<script src="js/lib/jquery.1.6.2.min.js" type="text/javascript"></script>
<script src="js/jquery.tutorial.js" type="text/javascript"></script>
</pre>
</div>
<div class="section">
<h2 class="round">Configuring the Tutorial</h2>
<p>
You have a few options when configuring the tutorial. To start the tutorial, you need to call <code>$('#tutorial').tutorial();</code>
anywhere in your application. You can optionally pass in an options object to this function by calling:
</p>
<pre class="prettyprint">
$('#tutorial').tutorial( options );
</pre>
<p>
These are the following options you can set:
</p>
<ul>
<li>
<h3>location</h3>
<p>Default: 'tl'
<p>Any one of the valid window location values mentioned below.</p>
</li>
<li>
<h3>width</h3>
<p>Default: 320</p>
<p>Integer, in pixels, for the width of the tutorial window.</p>
</li>
<li>
<h3>opacity</h3>
<p>Default: 0.4</p>
<p>Decimal between 0 and 1.0 for the overlay opacity. 1.0 is opaque.</p>
</li>
<li>
<h3>returnTop</h3>
<p>Default: true</p>
<p>Boolean signaling whether or not the tutorial should return the user back to the top of the page when complete.</p>
</li>
</ul>
</div>
<div class="section">
<h2 class="round">Structure of the Tutorial Element</h2>
<p>
The tutorial elementis simply a div with class <code>tutorial</code> containing a set of slide elements. To start,
add this code to your page:
</p>
<pre class="prettyprint">
<div id="tutorial" class="tutorial">
<!-- slides will go here -->
</div>
</pre>
<p>
The tutorial element contains a collection of slide <code>div</code>s with the following elements and HTML5 data properties:
</p>
<pre class="prettyprint" id="structure">
<div data-target="#selector .for:target" data-arrow="tc" data-location="tl">
<h1>Headline for Step 1</h1>
<p>
This is the message for Step 1.
</p>
</div>
</pre>
<p>
Each step <code>div</code> requires both the <code>data-target</code> and <code>data-arrow</code> properties to be set.
The <code>data-location</code> defaults to the options you specify when creating the tutorial. However, if you'd like
to move the location of the tutorial window for a certain step, set the <code>data-location</code> to one of 'tl', 'tr',
'bl', or 'br' for top left, tor right, bottom left, and bottom right respectively. You need to set it back in the next
step if you change the window location mid-tutorial.
</p>
<p>
Data arrow takes one of 'tc', 'ml', 'mr', or 'bc' for top center, middle left, middle right, or bottom center respectively.
You can mess around with these to see how they interact or take a look at the tutorial on this page by clicking "Start Demo"
at the top of the page.
</p>
</div>
<div class="section">
<h2 class="round">Setting the Target, Arrow, and Window Location</h2>
<h3>Target</h3>
<p class="padded">
The <code>data-target</code> property needs to be any valid, jQuery selector that targets <strong>one element</strong> on
the page. It could be an ID (preferred) or a selector choosing the first child, nth element, or anything at all selecting
one element. If you choose a selector with more than one it will default to the first element of that collection.
</p>
<h3>Arrow Location</h3>
<p>
Arrow locations can be any of the following options:
</p>
<ul>
<li>
<strong class="label">tc</strong>
<span>Top center</span>
</li>
<li>
<strong class="label">ml</strong>
<span>Middle left</span>
</li>
<li>
<strong class="label">mr</strong>
<span>Middle right</span>
</li>
<li>
<strong class="label">bc</strong>
<span>Bottom center</span>
</li>
</ul>
<h3>Window Location</h3>
<p>
Window location can be any of the following options:
</p>
<ul id="window-location">
<li>
<strong class="label">tl</strong>
<span>Top left</span>
</li>
<li>
<strong class="label">tr</strong>
<span>Top right</span>
</li>
<li>
<strong class="label">bl</strong>
<span>Bottom left</span>
</li>
<li>
<strong class="label">br</strong>
<span>Bottom right</span>
</li>
</ul>
<p class="padded">
It is important to note that if you change the window location mid-way through the tutorial, the window location will
remain at the new location until you change it back.
</p>
</div>
<div class="section">
<h2 class="round">Showing the Tutorial and Calling the Controls Programmatically</h2>
<p class="padded">
You have the ability to start the tutorial, move next or previous in the slides, or cancel the tutorial in your application.
To start the tutorial simply call <code>$('#tutorial').tutorial();</code>. <code>#tutorial</code> is the ID of the element
containing all of your slides. It needs to have class <code>tutorial</code> to work properly.
</p>
<h3>Next Slide</h3>
<p>
To move to the next slide, call the following on the same element you initialized the tutorial with:
</p>
<pre class="prettyprint">
$('#tutorial').tutorialNext();
</pre>
<h3>Previous Slide</h3>
<p>
To move to the previous slide, call the following on the same element you initialized the tutorial with:
</p>
<pre class="prettyprint">
$('#tutorial').tutorialPrev();
</pre>
<h3>Cancel Tutorial</h3>
<p>
To cancel the slideshow, call the following on the same element you initialized the tutorial with:
</p>
<pre class="prettyprint">
$('#tutorial').tutorialCancel();
</pre>
</div>
<div class="section">
<h2 class="round">Credits and More Info</h2>
<p class="padded">
jQuery Tutorial was written and coded by <a href="http://twitter.com/mikegioia">Mike Gioia</a> over at <a href="http://particlebits.com">ParticleBits</a>.
It was developed for <a href="http://playlistlove.com">PlaylistLove</a>, an awesome music discovery and song recommendation service.
</p>
<p>
For more information on this tutorial, please visit:
</p>
<ul>
<li>
Github: <a href="https://github.com/ParticleBits/jQuery-Tutorial" id="github-link">https://github.com/ParticleBits/jQuery-Tutorial</a>
</li>
<li>
Project Page: <a href="http://particlebits.com/code/jquery-tutorial" id="github-link">http://particlebits.com/code/jquery-tutorial</a>
</li>
</ul>
</div>
<div class="centered return">
<a href="#top">Return to Top of Page</a>
</div>
</div><!-- /content -->
</div><!-- /stage -->
<div id="footer">
Written and developed by ParticleBits. ParticleBits is a development journal started by the Gioia brothers + DeRoner.
</div><!-- /footer -->
<div id="tutorial" class="tutorial">
<div data-target="#start" data-arrow="tc" data-location="tl">
<h1>Starting the Tutorial</h1>
<p>
Simply call $('#tutorial').tutorial() on the element you've set up and voila!
</p>
</div>
<div data-target="#includes" data-arrow="ml" data-location="tr">
<h1>Set the Arrow Positions</h1>
<p>
You can set the arrow position to top center (tc), middle left (ml), middle right (mr), or bottom center (bc).
</p>
</div>
<div data-target="#structure" data-arrow="ml" data-location="br">
<h1>Set the Window Positions</h1>
<p>
You can set the window position to top left (tl), top right (tr), bottom left (bl), or bottom right (br).
</p>
</div>
<div data-target="ul#window-location li:last span" data-arrow="bc" data-location="tl">
<h1>Target Any Page Element</h1>
<p>
This slide targets "ul#window-location li:last span". Any valid jQuery selector will work.
</p>
</div>
<div data-target="#github-link" data-arrow="tc" data-location="tl">
<h1>Fork the Code & Contribute!</h1>
<p>
Check out the Github page and if you're feeling generous, fork the code and contribute updates!
</p>
</div>
</div><!-- /tutorial -->
</body>
</html>