|
UIPullRefreshMotive模块(界面布局-下拉刷新)demo示例
[复制链接]
- <!DOCTYPE html>
- <html>
- <head>
- <meta charset="utf-8">
- <meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0" />
- <meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
- <title>title</title>
- <link rel="stylesheet" type="text/css" href="../css/api.css" />
- <style>
- body {
- }
- html, body {
- height: 100%
- }
- body {
- background-color: #fff;
- margin: 0;
- }
- #wrap {
- height: 100%;
- position: relative;
- }
- #header {
- padding-top: 20px;
- background-color: #5082c2;
- height: 44px;
- position: relative;
- }
- #header h1 {
- font-size: 20px;
- height: 44px;
- line-height: 44px;
- margin: 0em;
- color: #fff;
- margin-left: 100px;
- margin-right: 100px;
- text-align: center;
- }
- #main {
- display: -webkit-box;
- -webkit-box-orient: vertical;
- -webkit-box-pack: center;
- }
- a.button {
- display: -webkit-box;
- -webkit-box-orient: vertical;
- -webkit-box-pack: center;
- -webkit-box-align: center;
- height: 32px;
- margin: 8px;
- background-color: rgba(240, 240, 240, 1.0);
- border-color: rgba(220, 220, 220, 1.0);
- border-width: 2px;
- border-style: solid;
- }
- a.active {
- background-color: rgba(240, 240, 240, 0.7);
- }
- </style>
- </head>
- <body>
- <a class="button" tapmode="active" onclick="fnRefreshHeaderLoading()">手动开始下拉刷新的加载状态</a>
- <a class="button" tapmode="active" onclick="fnrefreshHeaderLoadDone()">手动停止下拉刷新的加载状态</a>
- </body>
- <script type="text/javascript" src="../script/api.js"></script>
- <script type="text/javascript">
- apiready = function() {
- api.setCustomRefreshHeaderInfo({
- bgColor : '#eee',
- images : ['widget://image/dropdown_anim_00.png', 'widget://image/dropdown_anim_01.png', 'widget://image/dropdown_anim_02.png', 'widget://image/dropdown_anim_03.png', 'widget://image/dropdown_anim_04.png', 'widget://image/dropdown_anim_05.png', 'widget://image/dropdown_anim_06.png','widget://image/dropdown_anim_07.png','widget://image/dropdown_anim_08.png','widget://image/dropdown_anim_09.png','widget://image/dropdown_anim_10.png'],
- tips : {
- pull : '下拉刷新',
- threshold : '松开立即刷新',
- load : '正在刷新'
- }
- }, function() {
- //下拉刷新被触发,自动进入加载状态,使用 api.refreshHeaderLoadDone() 手动结束加载中状态
- //下拉刷新被触发,使用 api.refreshHeaderLoadDone() 结束加载中状态
- alert('开始加载刷新数据,摇一摇停止加载状态');
- api.addEventListener({
- name : 'shake'
- }, function(ret, err) {
- api.refreshHeaderLoadDone()
- });
- });
- };
- function fnRefreshHeaderLoading() {
- api.refreshHeaderLoading();
- }
- function fnrefreshHeaderLoadDone() {
- api.refreshHeaderLoadDone();
- }
- </script>
- </html>
复制代码 UIPullRefreshMotive模块demo分享
|
本帖子中包含更多资源,您需要 登录 才可以下载或查看,没有帐号?立即注册
X
|