forked from dezignhero/swiper.js
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
52 lines (46 loc) · 2.15 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
<!DOCTYPE html>
<head>
<title>Swiper.js</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link href='http://fonts.googleapis.com/css?family=Open+Sans:300' rel='stylesheet' type='text/css'>
<style>
* { margin: 0; padding: 0; font-family: 'Open Sans', Arial; }
html, body { width: 100%; height: 100%; background: #ccc; }
/* Pages */
#Pages { width: 100%; height: 100%; overflow: hidden; }
#Pages .container,
#Pages .page { float: left; width: 100%; height: 100%; background: #fcfcfc; }
#Pages .page { list-style: none; text-align: center; position: relative; }
#Pages .page span { display: block; position: absolute; top: 50%; left: 50%; width: 80%; height: 160px; margin: -80px 0 0 -40%; font-size: 48px; letter-spacing:-3px; color: #6c6c6c; -webkit-user-select: none; }
/* Controls */
.control { position: absolute; top: 50%; margin-top: -30px; padding: 10px; width: 60px; height: 60px; z-index: 100; cursor: pointer; color: #fff; line-height: 60px; font-weight: bold; border-radius: 60px; text-align: center; -webkit-user-select: none; }
.control.prev { left: 5px; background: red; }
.control.next { right: 5px; background: blue; }
</style>
</head>
<body>
<div id="Pages">
<ul class="container">
<li class="page"><span>You can either swipe or use the controls to move the slides.</span></li>
<li class="page"><span>Swiper.js uses CSS3 transforms for a smooth swipe.</span></li>
<li class="page"><span>You can alter how fast the slides move in the declaration.</span></li>
<li class="page"><span>Notice the next button disappears since you've reached the end.</span></li>
</ul>
<div class="control prev" data-action="prev">Prev</div>
<div class="control next" data-action="next">Next</div>
</div>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<script src="swiper.js"></script>
<script>
var s;
$(document).ready(function(){
s = new Swiper('#Pages');
// Demonstrate bound event for updating slides
s.element.on('update', function(e, current, total) {
console.log('Slide '+current+' of '+total);
});
});
</script>
</body>
</html>