-
Notifications
You must be signed in to change notification settings - Fork 14
/
3_0_fade.html
56 lines (53 loc) · 1.9 KB
/
3_0_fade.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
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="renderer" content="webkit">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
<title>Fade</title>
<link rel="stylesheet" href="../dist/do-slide.min.css">
<link rel="stylesheet" href="css/common.css">
<style>
div.container > * {
position: absolute;
-webkit-transition: opacity 1s;
transition: opacity 1s;
opacity: 0;
}
</style>
</head>
<body>
<div class="wrap ds-parent">
<div class="ds-container container">
<div class="section">
<span class="arrow down"></span>
</div>
<div class="section">
<span class="arrow down"></span>
<span class="arrow up"></span>
</div>
<div class="section">
<span class="arrow down"></span>
<span class="arrow up"></span>
</div>
<div class="section">
<span class="arrow up"></span>
</div>
</div>
</div>
<script type="text/javascript" src="../dist/do-slide.min.js"></script>
<script type="text/javascript">
var slide = new DoSlide('.container', {
silent: true,
duration: 1000
})
slide.onBeforeChange(function(curIndex, tarIndex, cur, tar) {
this.$(cur).css('opacity', '0')
this.$(tar).css('opacity', '1')
}).do(function(curIndex, cur) {
this.$(cur).css('opacity', '1') // init
})
</script>
</body>
</html>