forked from electerious/basicSlider
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathexample.html
146 lines (125 loc) · 4.43 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
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="x-ua-compatible" content="ie=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- WEBSITE DETAIL -->
<title>hSlider Demo</title>
<meta name="theme-color" content="#00aadc">
<meta name="description" content="A Responsive & Touch-friendly Javascript Slider, only 2.3 KB gzipped.">
<!-- STYLESHEET -->
<link rel="stylesheet" href="https://cdn.pixelstudio.id/css/normalize.css">
<link rel="stylesheet" href="dist/h-slider.css">
<style>
main {
padding: 3rem 10px;
max-width: 960px;
margin: 0 auto;
}
a {
display: block;
}
img {
width: 100%;
}
article a {
display: inline-block;
margin-top: 0.5em;
padding: 0.25em 0.5em;
border: 1px solid #333;
border-radius: 4px;
}
</style>
</head>
<body>
<main>
<h1>Image Slider (4)</h1>
<div id="image-gallery">
<img src="https://picsum.photos/400/300?image=1043">
<img src="https://picsum.photos/400/300?image=1039">
<img src="https://picsum.photos/400/300?image=1044">
<img src="https://picsum.photos/400/300?image=1036">
<img src="https://picsum.photos/400/300?image=841">
<img src="https://picsum.photos/400/300?image=1015">
<img src="https://picsum.photos/400/300?image=987">
<img src="https://picsum.photos/400/300?image=980">
</div>
<h1>Text Slider (2)</h1>
<div id="text-gallery">
<article>
<h3>Hello World</h3>
<p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Qui ratione eos quia?</p>
<a href="https://github.com/hrsetyono/hSlider" target="_blank">Visit Github</a>
</article>
<article>
<h3>Magnam Culpa</h3>
<p>Quod incidunt obcaecati repellendus assumenda dolor, suscipit, natus nihil cum, dignissimos nesciunt sequi eius ea laborum pariatur.</p>
<a href="https://github.com/hrsetyono/hSlider" target="_blank">Visit Github</a>
</article>
<article>
<h3>Impedit Rerum</h3>
<p>Temporibus labore nulla animi explicabo fugiat vel deleniti perspiciatis dolores debitis, suscipit excepturi, dolore enim architecto</p>
<a href="https://github.com/hrsetyono/hSlider" target="_blank">Visit Github</a>
</article>
<article>
<h3>Repellendus Neque</h3>
<p>Sit consequatur voluptate laboriosam. Molestias libero asperiores quod voluptates, inventore maiores ratione? Porro, accusantium.</p>
<a href="https://github.com/hrsetyono/hSlider" target="_blank">Visit Github</a>
</article>
</div>
<h1>Responsive Slider (3 > 2 > 1)</h1>
<div id="responsive-gallery">
<a href="https://picsum.photos/600/450?image=951" target="_blank">
<img src="https://picsum.photos/600/450?image=951">
</a>
<a href="https://picsum.photos/600/450?image=818" target="_blank">
<img src="https://picsum.photos/600/450?image=818">
</a>
<a href="https://picsum.photos/600/450?image=760" target="_blank">
<img src="https://picsum.photos/600/450?image=760">
</a>
<a href="https://picsum.photos/600/450?image=623" target="_blank">
<img src="https://picsum.photos/600/450?image=623">
</a>
<a href="https://picsum.photos/600/450?image=583" target="_blank">
<img src="https://picsum.photos/600/450?image=583">
</a>
<a href="https://picsum.photos/600/450?image=440" target="_blank">
<img src="https://picsum.photos/600/450?image=440">
</a>
<a href="https://picsum.photos/600/450?image=375" target="_blank">
<img src="https://picsum.photos/600/450?image=375">
</a>
<a href="https://picsum.photos/600/450?image=216" target="_blank">
<img src="https://picsum.photos/600/450?image=216">
</a>
<a href="https://picsum.photos/600/450?image=175" target="_blank">
<img src="https://picsum.photos/600/450?image=175">
</a>
</div>
</main>
<script src="src/h-slider.js"></script>
<script>
document.addEventListener('DOMContentLoaded', () => {
hSlider( document.querySelector('#image-gallery'), {
itemsPerSlide: 4,
} )
hSlider( document.querySelector('#text-gallery'), {
itemsPerSlide: 2,
} );
hSlider( document.querySelector('#responsive-gallery'), {
index: 2, // starting slide
arrows: true,
dots: true,
touch: true,
itemsPerSlide: 3,
responsive: {
767: 2, // 2 items when 767px or below
480: 1 // 1 item when 480px or below
}
});
});
</script>
</body>
</html>