nested_muitransparent.html
5.08 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
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
<!--
作者:dailc
时间:2017-09-07
描述: mui透明状态栏
-->
<!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>muibar transparent</title>
<link rel="stylesheet" href="libs/mui/css/mui.min.css" />
<link rel="stylesheet" href="../../dist/debug/minirefresh.css" />
<link rel="stylesheet" href="../common/common.css" />
<style>
.navbar-header {
background-color: rgba(247, 247, 247, 0);
border-bottom: none;
}
.minirefresh-wrap {
top: 0;
}
.minirefresh-theme-default .minirefresh-downwrap {
top: 45px;
}
</style>
</head>
<body>
<nav class="navbar-header mui-bar mui-bar-transparent">
<a class="nav-btn-left" href="../index.html">dashboard</a>
嵌套mui的透明进度条
</nav>
<div class="content">
<div id="minirefresh" class="minirefresh-wrap">
<div class="minirefresh-scroll">
<!-- 一个轮播示例,可以是其它的轮播 -->
<div id="gallert-slider" class="mui-slider">
<div class="mui-slider-group mui-slider-loop">
<!-- 额外增加的一个节点(循环轮播:第一个节点是最后一张轮播) -->
<div class="mui-slider-item mui-slider-item-duplicate">
<a href="#">
<img src="../images/yuantiao.jpg">
</a>
</div>
<!-- 第一张 -->
<div class="mui-slider-item">
<a href="#">
<img src="../images/shuijiao.jpg">
</a>
</div>
<!-- 第二张 -->
<div class="mui-slider-item">
<a href="#">
<img src="../images/muwu.jpg">
</a>
</div>
<!-- 额外增加的一个节点(循环轮播:最后一个节点是第一张轮播) -->
<div class="mui-slider-item mui-slider-item-duplicate">
<a href="#">
<img src="../images/shuijiao.jpg">
</a>
</div>
</div>
<div class="mui-slider-indicator">
<div class="mui-indicator mui-active"></div>
<div class="mui-indicator"></div>
<div class="mui-indicator"></div>
<div class="mui-indicator"></div>
</div>
</div>
<ul class="data-list" id="listdata">
</ul>
</div>
</div>
</div>
<script type="text/javascript" src="libs/mui/js/mui.js"></script>
<script type="text/javascript" src="../../dist/debug/minirefresh.js"></script>
<script type="text/javascript" src="../common/common.js"></script>
<script>
// 如果需要除body之外的dom对象也支持Mui的透明滑动
// 可以更改mui.js-3.7源码,8018行,y的位置变为scrollby.scrollTop而不是window.scrollY
var appendTestData = Common.appendTestData,
// 记录一个最新
maxDataSize = 30,
listDom = document.querySelector('#listdata'),
requestDelayTime = 600;
var miniRefresh = new MiniRefresh({
container: '#minirefresh',
// 开启使用body的scroll以用来适应mui的bar-transparent
isUseBodyScroll: true,
down: {
callback: function() {
setTimeout(function() {
// 每次下拉刷新后,上拉的状态会被自动重置
appendTestData(listDom, 10, true);
miniRefresh.endDownLoading(true);
}, requestDelayTime);
}
},
up: {
isAuto: true,
callback: function() {
setTimeout(function() {
appendTestData(listDom, 4);
miniRefresh.endUpLoading(listDom.children.length >= maxDataSize ? true : false);
}, requestDelayTime);
}
}
});
</script>
</body>
</html>