theme_drawerslider.html
2.56 KB
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
<!--
作者:dailc
时间:2017-08-30
描述: 滑动抽屉效果
-->
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1,user-scalable=no">
<meta name="apple-mobile-web-app-capable" content="yes">
<title>MiniFresh theme drawerslider</title>
<link rel="stylesheet" href="../../dist/debug/minirefresh.css" />
<link rel="stylesheet" href="../../dist/debug/themes/drawerslider/minirefresh.theme.drawerslider.css" />
<link rel="stylesheet" href="../common/common.css" />
</head>
<body>
<nav class="navbar-header">
<a class="nav-btn-left" href="../index.html">dashboard</a>
滑动抽屉效果
</nav>
<div class="content">
<div id="minirefresh" class="minirefresh-wrap">
<div class="minirefresh-scroll">
<ul class="data-list" id="listdata">
</ul>
</div>
</div>
</div>
<script type="text/javascript" src="../../dist/debug/minirefresh.js"></script>
<script type="text/javascript" src="../../dist/debug/themes/drawerslider/minirefresh.theme.drawerslider.js"></script>
<script type="text/javascript" src="../common/common.js"></script>
<script>
var appendTestData = Common.appendTestData,
// 记录一个最新
maxDataSize = 30,
listDom = document.querySelector('#listdata'),
requestDelayTime = 600;
var miniRefresh = new MiniRefresh({
container: '#minirefresh',
down: {
callback: function() {
setTimeout(function() {
// 每次下拉刷新后,上拉的状态会被自动重置
appendTestData(listDom, 10, true);
miniRefresh.endDownLoading(true);
}, requestDelayTime);
}
},
up: {
isAuto: true,
callback: function() {
setTimeout(function() {
appendTestData(listDom, 10);
miniRefresh.endUpLoading(listDom.children.length >= maxDataSize ? true : false);
}, requestDelayTime);
}
}
});
</script>
</body>
</html>