This repository was archived by the owner on Mar 20, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 21
Expand file tree
/
Copy pathindex.html
More file actions
319 lines (284 loc) · 10.2 KB
/
index.html
File metadata and controls
319 lines (284 loc) · 10.2 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
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=Edge;chrome=1" />
<title>jQuery Slideshow</title>
<link rel="stylesheet" href="css/example.css" />
<link rel="stylesheet" href="css/pygments.css" />
<link rel="stylesheet" href="css/slideshow.css" />
<!--
jQuery Slideshow by Matt Hinchliffe <http://www.maketea.co.uk>
Find out more at GitHub <http://github.com/i-like-robots/jQuery-Slideshow>
-->
<!-- Google Analytics tracking code -->
<script>
var _gaq=[['_setAccount','UA-2508361-10'],['_trackPageview']];
(function(d,t){var g=d.createElement(t),s=d.getElementsByTagName(t)[0];
g.src=('https:'==location.protocol?'//ssl':'//www')+'.google-analytics.com/ga.js';
s.parentNode.insertBefore(g,s)}(document,'script'));
</script>
</head>
<body>
<div id="container">
<section id="introduction">
<h1>jQuery Slideshow</h1>
<p>
<a href="http://github.com/i-like-robots/jQuery-Slideshow">jQuery Slideshow</a> is a performant,
flexible and developer friendly image slideshow and content carousel plugin. 2KB when
gzipped. <a href="https://github.com/i-like-robots/jQuery-Slideshow/zipball/master">Download</a>.
</p>
<div id="example">
<div class="slideshow" data-transition="crossfade" data-loop="true" data-skip="false">
<ul class="carousel">
<li class="slide">
<img src="http://placebox.es/440/200/d97ef2/f5f5f5" alt="" width="440" height="200" />
</li>
<li class="slide">
<img src="http://placebox.es/440/200/50ac3d/f5f5f5" alt="" width="440" height="200" />
</li>
<li class="slide">
<img src="http://placebox.es/440/200/0a77bb/f5f5f5" alt="" width="440" height="200" />
</li>
</ul>
</div>
<p>
<label for="transition">Change the transition:</label>
<select name="transition" id="transition">
<option selected>crossfade</option>
<option>scroll</option>
</select>
</p>
<div class="slideshow" data-visible="4" data-pagination="false">
<ul class="carousel">
<li class="slide">
<img src="http://placebox.es/110/110/d97ef2/f5f5f5" alt="" width="110" height="110" />
</li>
<li class="slide">
<img src="http://placebox.es/110/110/50ac3d/f5f5f5" alt="" width="110" height="110" />
</li>
<li class="slide">
<img src="http://placebox.es/110/110/0a77bb/f5f5f5" alt="" width="110" height="110" />
</li>
<li class="slide">
<img src="http://placebox.es/110/110/d97ef2/f5f5f5" alt="" width="110" height="110" />
</li>
<li class="slide">
<img src="http://placebox.es/110/110/50ac3d/f5f5f5" alt="" width="110" height="110" />
</li>
<li class="slide">
<img src="http://placebox.es/110/110/0a77bb/f5f5f5" alt="" width="110" height="110" />
</li>
<li class="slide">
<img src="http://placebox.es/110/110/d97ef2/f5f5f5" alt="" width="110" height="110" />
</li>
<li class="slide">
<img src="http://placebox.es/110/110/50ac3d/f5f5f5" alt="" width="110" height="110" />
</li>
<li class="slide">
<img src="http://placebox.es/110/110/0a77bb/f5f5f5" alt="" width="110" height="110" />
</li>
</ul>
</div>
</div>
</section>
<hr />
<section id="setup">
<h2>Setup</h2>
<p>
Setup is not restricted to a fixed markup pattern. Theoretically almost any content can be placed
within a slide. If you are using images you should always specify the width and height attributes
so that layout calculations can be done without waiting for the assets to finish downloading.
</p>
<figure>
<pre class="syntax"><code><span class="nt"><div</span> <span class="na">class=</span><span class="s">"slideshow"</span><span class="nt">></span>
<span class="nt"><ul</span> <span class="na">class=</span><span class="s">"carousel"</span><span class="nt">></span>
<span class="nt"><li</span> <span class="na">class=</span><span class="s">"slide"</span><span class="nt">></span>…<span class="nt"></li></span>
<span class="nt"><li</span> <span class="na">class=</span><span class="s">"slide"</span><span class="nt">></span>…<span class="nt"></li></span>
<span class="nt"><li</span> <span class="na">class=</span><span class="s">"slide"</span><span class="nt">></span>…<span class="nt"></li></span>
<span class="nt"></ul></span>
<span class="nt"></div></span></code>
</pre>
</figure>
<p>
The plugin is instantiated in the usual manner and an instances API can be accessed via element data.
</p>
<figure>
<pre class="syntax"><code><span class="c1">// Create slideshow instances</span>
<span class="kd">var</span> <span class="nx">$slideshow</span> <span class="o">=</span> <span class="nx">$</span><span class="p">(</span><span class="s1">'.slideshow'</span><span class="p">).</span><span class="nx">slides</span><span class="p">(),</span>
<span class="c1">// Access an instance API</span>
<span class="nx">api</span> <span class="o">=</span> <span class="nx">$slideshow</span><span class="p">.</span><span class="nx">data</span><span class="p">(</span><span class="s1">'slides'</span><span class="p">);</span></code>
</pre>
</figure>
</section>
<hr />
<section id="options">
<h2>Options</h2>
<p>
Global options can be specified via the standard jQuery plugin interface or as data attributes on
individual slideshow elements. Remember that <kbd>camelCase</kbd> options should be written as
<kbd>hyphen-separated</kbd> attributes, for example the <code>hoverPause</code> option would be defined
on the element with the <code>data-hover-pause</code> attribute.
</p>
<figure>
<pre class="syntax"><code><span class="nt"><div</span> <span class="na">class=</span><span class="s">"slideshow"</span>
<span class="na">data-pagination=</span><span class="s">"true"</span>
<span class="na">data-loop=</span><span class="s">"false"</span>
<span class="na">data-transition=</span><span class="s">"crossfade"</span><span class="nt">></span></code>
</pre>
</figure>
<h3>Setup</h3>
<dl id="options-setup">
<dt>carousel</dt>
<dd>
Selector for the carousel element. Default: <code>".carousel"</code>.
</dd>
<dt>items</dt>
<dd>
Selector for carousel items. Default: <code>".slide"</code>.
</dd>
<dt>slideWidth</dt>
<dd>
Set a fixed width for each slide. Default: <code>false</code>.
</dd>
<dt>jumpQueue</dt>
<dd>
Allow .to() method while animations are queued. Default: <code>true</code>.
</dd>
<dt>offset</dt>
<dd>
Starting slide. Default: <code>1</code>.
</dd>
</dl>
<h3>Controls</h3>
<dl id="options-controls">
<dt>skip</dt>
<dd>
Render next/previous skip buttons. Default: <code>true</code>.
</dd>
<dt>pagination</dt>
<dd>
Render pagination. Default: <code>true</code>.
</dd>
<dt>auto</dt>
<dd>
Autoplay timeout in milliseconds. Set to a falsy value for no autoplay. Default: <code>6000</code>.
</dd>
<dt>autostop</dt>
<dd>
Stop autoplay when user manually changes slide. Default: <code>true</code>.
</dd>
<dt>hoverPause</dt>
<dd>
Pause autoplay on hover. Default: <code>false</code>.
</dd>
<dt>loop</dt>
<dd>
Allow slideshow to loop. Default: <code>false</code>.
</dd>
<dt>nextText</dt>
<dd>
Text to display on next skip button. Default: <code>"Next"</code>.
</dd>
<dt>previousText</dt>
<dd>
Text to display on previous skip button. Default: <code>"Previous"</code>.
</dd>
</dl>
<h3>Transitions</h3>
<dl id="options-transitions">
<dt>transition</dt>
<dd>
Specify transition (<code>crossfade</code> or <code>scroll</code>). Default: <code>"scroll"</code>.
</dd>
<dt>speed</dt>
<dd>
Animation speed between slides in milliseconds. Default: <code>600</code>.
</dd>
<dt>easing</dt>
<dd>
Animation easing between slides. Default: <code>"swing"</code>.
</dd>
<dt>visible</dt>
<dd>
Approximate number of slides visible (scroll transition only). Default: <code>1</code>.
</dd>
</dl>
<h3>Callbacks</h3>
<dl id="options-callbacks">
<dt>onupdate</dt>
<dd>
A callback function to execute on slide change. Default: <code>false</code>.
</dd>
<dt>oncomplete</dt>
<dd>
A callback function to execute on slide transition complete. Default: <code>false</code>.
</dd>
</dl>
<p>
<em>If callbacks are specified as data attributes they must reference functions within the global
(<code>window</code>) namespace.</em>
</p>
</section>
<hr />
<section id="api">
<h2>Public methods</h2>
<dl>
<dt>.hasNext()</dt>
<dd>
Are there any slides after current item or can the carousel be scrolled any further (ignores loop). Returns <code>boolean</code>.
</dd>
<dt>.hasPrevious()</dt>
<dd>
Are there any slides previous to current item (ignores loop). Returns <code>boolean</code>.
</dd>
<dt>.next()</dt>
<dd>
Go to the next slide.
</dd>
<dt>.previous()</dt>
<dd>
Go to previous slide.
</dd>
<dt>.to(index)</dt>
<dd>
Go to slide. <var>Index</var> Slide position.
</dd>
<dt>.redraw([transition])</dt>
<dd>
Redraw the carousel. <var>Transition</var> New transition style.
</dd>
<dt>.play()</dt>
<dd>
Start autoplay.
</dd>
<dt>.pause()</dt>
<dd>
Pause autoplay.
</dd>
<dt>.stop()</dt>
<dd>
Stop autoplay entirely.
</dd>
</dl>
</section>
</div>
<a href="http://github.com/i-like-robots/jQuery-Slideshow">
<img style="position:absolute; top:0; right:0; border:0;" src="https://s3.amazonaws.com/github/ribbons/forkme_right_darkblue_121621.png" alt="Fork me on GitHub" />
</a>
<script src="http://code.jquery.com/jquery-1.11.0.min.js"></script>
<script src="dist/slideshow.js"></script>
<script>
$(function() {
// Create slideshow instances
var $s = $('.slideshow').slides();
// Access an instance API
var api = $s.eq(0).data('slides');
// Transition select
$('select[name=transition]').on('change', function() {
api.redraw( this.value );
});
});
</script>
</body>
</html>