-
Notifications
You must be signed in to change notification settings - Fork 11
/
index.html
149 lines (145 loc) · 5.13 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
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>TouchScroll</title>
<meta name="description" content="" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link rel="stylesheet" href="css/carousel.css" />
<link rel="stylesheet" href="css/viewer.css" />
<link rel="stylesheet" href="css/timer.css" />
<link rel="stylesheet" href="css/carouselDnD.css" />
</head>
<body>
<a href="https://github.com/kmturley/touch-scroll" target="_blank"><img style="position: absolute; top: 0; right: 0; border: 0;" src="https://camo.githubusercontent.com/38ef81f8aca64bb9a64448d0d70f1308ef5341ab/68747470733a2f2f73332e616d617a6f6e6177732e636f6d2f6769746875622f726962626f6e732f666f726b6d655f72696768745f6461726b626c75655f3132313632312e706e67" alt="Fork me on GitHub" data-canonical-src="https://s3.amazonaws.com/github/ribbons/forkme_right_darkblue_121621.png"></a>
<h1>Touch Scroll</h1>
<p>Drag a native browser scroll area around! Works on Chrome (latest), Safari (latest), Firefox (latest), IE8+</p>
<h2>Viewer</h2>
<div class="viewer no-select" id="viewer">
<img src="img/photo.jpg" alt="" draggable="false" id="photo" />
</div>
<h2>Carousel</h2>
<div class="carousel">
<a href="#/carousel/previous/" class="prev" id="prev">◀</a>
<ul id="carousel">
<li>
<a href="#">
<img src="img/photo-small.jpg" alt="" />
<span>Item 1</span>
</a>
</li>
<li>
<a href="#">
<img src="img/photo-small.jpg" alt="" />
<span>Item 2</span>
</a>
</li>
<li>
<a href="#">
<img src="img/photo-small.jpg" alt="" />
<span>Item 3</span>
</a>
</li>
<li>
<a href="#">
<img src="img/photo-small.jpg" alt="" />
<span>Item 4</span>
</a>
</li>
<li>
<a href="#">
<img src="img/photo-small.jpg" alt="" />
<span>Item 5</span>
</a>
</li>
<li>
<a href="#">
<img src="img/photo-small.jpg" alt="" />
<span>Item 6</span>
</a>
</li>
<li>
<a href="#">
<img src="img/photo-small.jpg" alt="" />
<span>Item 7</span>
</a>
</li>
<li>
<a href="#">
<img src="img/photo-small.jpg" alt="" />
<span>Item 8</span>
</a>
</li>
</ul>
<a href="#/carousel/next/" class="next" id="next">▶</a>
</div>
<h2>Carousel with Drag and Drop</h2>
<p>Hold and drag to the left or right to scroll</p>
<p>Hold an image for a sec. to enable drag and drop. Hold it again to deactivate dnd</p>
<div class="carousel carouselDnD">
<a href="#/carousel/previous/" class="prev" id="prev">◀</a>
<ul id="carousel-draggable">
<li>
<img src="img/photo-small.jpg" alt="" />
<span>Item 1</span>
</li>
<li>
<img src="img/photo-small.jpg" alt="" />
<span>Item 2</span>
</li>
<li>
<img src="img/photo-small.jpg" alt="" />
<span>Item 3</span>
</li>
<li>
<img src="img/photo-small.jpg" alt="" />
<span>Item 4</span>
</li>
<li>
<img src="img/photo-small.jpg" alt="" />
<span>Item 5</span>
</li>
<li>
<img src="img/photo-small.jpg" alt="" />
<span>Item 6</span>
</li>
<li>
<img src="img/photo-small.jpg" alt="" />
<span>Item 7</span>
</li>
<li>
<img src="img/photo-small.jpg" alt="" />
<span>Item 8</span>
</li>
</ul>
<a href="#/carousel/next/" class="next" id="next">▶</a>
</div>
<script src="js/RequestAnimationFrame.js"></script>
<script src="js/TouchScroll.js"></script>
<script src="js/dragDrop.js"></script>
<script>
var viewer = new TouchScroll();
viewer.init({
id: 'viewer',
draggable: true,
wait: false
});
var carousel = new TouchScroll();
carousel.init({
id: 'carousel',
prev: 'prev',
next: 'next',
distance: 200
});
var carousel = new TouchScroll();
carousel.init({
id: 'carousel-draggable',
prev: 'prev',
next: 'next',
distance: 200,
draggable: true,
ignoreDraggableElements: true
});
</script>
</body>
</html>