-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathexample.html
72 lines (67 loc) · 1.8 KB
/
example.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
<!doctype html>
<html lang="nl">
<head>
<meta charset="utf-8">
<title>Swipe demo</title>
<meta name="description" content="Swipe demo">
<meta name="author" content="Cipix Internet">
<style>
#slideshow {
width: 552px;
height: 384px;
position: relative;
overflow: hidden;
}
#slideshow .container {
position: absolute;
left: 0;
width: 100000px;
}
#slideshow .item {
float: left;
display: block;
}
</style>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
<script src="jquery.swipe.js"></script>
</head>
<body>
<article id="slideshow">
<div class="container">
<article class="item">
<div style="width:512px;height:384px;background-color:#ff0000" />
</article>
<article class="item">
<div style="width:512px;height:384px;background-color:#00ff00" />
</article>
<article class="item">
<div style="width:512px;height:384px;background-color:#0000ff" />
</article>
<article class="item">
<div style="width:512px;height:384px;background-color:#ff00ff" />
</article>
</div>
</article>
<script>
// Init slideshow.
var slideshow = $('#slideshow').swipe({
container: $('#slideshow .container'),
debug: false, /* Set to true to listen to mouse events instead of touch events */
swipeThreshold: 0,
});
// Listen to swipe events.
$('#slideshow').bind('changeitem', function(slideshow, item, currentItemIndex) {
// Reset timer.
clearTimeout(timer);
timer = setTimeout(autoScroll, 5000);
});
// Auto scroll.
var timer = null;
var autoScroll = function() {
slideshow.move(1, true);
}
// Start initial auto scroll.
timer = setTimeout(autoScroll, 5000);
</script>
</body>
</html>