帖子
帖子
用户
博客
课程
显示全部楼层
回帖奖励
4 Y币
回复本帖可获得 1 Y币奖励! 每人限 1 次
1682
帖子
10
勋章
Y币

UILoading 模块demo源码示例

  [复制链接]
发表于 2017-8-1 10:34:55
UILoading 模块封装了两种款式的加载提示框,每一种款式都提供一个接口来调用。开发者可参考各个接口的样式来自定义加载提示框上的图片信息。

点击进入模块详情

index.html
  1. <!doctype html>
  2. <html>
  3. <head>
  4.     <meta charset="utf-8">
  5.     <meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0"/>
  6.     <meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
  7.     <style type="text/css">
  8.         html{ background-color: white; }
  9.         header{ border-bottom: 1px solid #ccc; padding: 25px 0; }
  10.         span {
  11.             padding: 10px 15px;
  12.             margin: 10px;
  13.             display: inline-block;
  14.             background-color: #e8e8e8;
  15.         }
  16.         .hover{ opacity: .4; }
  17.     </style>
  18. </head>
  19. <body>
  20.     <header>
  21.         <h1>UILoading</h1>
  22.         <mark>
  23.             使用前请详细阅读 文档 使用规则
  24.         </mark>
  25.     </header>
  26.     <span tapmode="hover" onclick="fnFlower()">flower</span>
  27.     <span tapmode="hover" onclick="fnKeyFrame()">keyFrame</span>
  28.     <span tapmode="hover" onclick="fnCloseFlower()">closeFlower</span>
  29.     <span tapmode="hover" onclick="fnCloseKeyFrame()">closeKeyFrame</span>
  30. </body>
  31. <script type="text/javascript">
  32.     var UILoading;
  33.     apiready = function() {
  34.         UILoading = api.require('UILoading');
  35.     };
  36.     function fnFlower(){
  37.         UILoading.flower({
  38.             center: {                           
  39.                 x: 160,            
  40.                 y: 300         
  41.             },
  42.             size: 30,
  43.             fixed: true
  44.         }, function(ret){   
  45.             alert(JSON.stringify(ret));
  46.         });
  47.     }
  48.     function fnKeyFrame(){
  49.         UILoading.keyFrame({
  50.             rect: {
  51.                 w: 80,                              
  52.                 h: 100      
  53.             },
  54.             styles: {
  55.                 bg: 'rgba(0,0,0,0.5)',
  56.                 corner: 5,
  57.                 interval: 50,
  58.                 frame:{
  59.                     w: 80,
  60.                     h: 80
  61.                 }
  62.             }
  63.         }, function(ret){   
  64.             alert(JSON.stringify(ret));
  65.         });
  66.     }
  67.     function fnCloseFlower(){
  68.         UILoading.closeFlower ({
  69.             id: 0
  70.         });
  71.     }
  72.     function fnCloseKeyFrame(){
  73.         UILoading.closeKeyFrame();
  74.     }
  75. </script>
  76. </html>
复制代码



config.xml
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <widget id="A0000000000001"  version="0.0.1">
  3.     <name>UILoading</name>
  4.     <description>
  5.         Example For APICloud.
  6.     </description>
  7.     <author email="developer@apicloud.com" href="http://www.apicloud.com">
  8.         Developer
  9.     </author>
  10.     <content src="index.html" />
  11.     <access origin="*" />
  12.     <preference name="pageBounce" value="false"/>
  13.         <preference name="appBackground" value="rgba(0,0,0,0.0)"/>
  14.         <preference name="windowBackground" value="rgba(0,0,0,0.0)"/>
  15.         <preference name="frameBackgroundColor" value="rgba(0,0,0,0.0)"/>
  16.         <preference name="hScrollBarEnabled" value="true"/>
  17.         <preference name="vScrollBarEnabled" value="true"/>
  18.         <preference name="autoLaunch" value="true"/>
  19.         <preference name="fullScreen" value="false"/>
  20.         <preference name="autoUpdate" value="true" />
  21.         <preference name="smartUpdate" value="false" />
  22.         <preference name="debug" value="true"/>
  23.         <preference name="statusBarAppearance" value="true"/>
  24.         <permission name="readPhoneState" />
  25.         <permission name="camera" />
  26.         <permission name="record" />
  27.         <permission name="location" />
  28.         <permission name="fileSystem" />
  29.         <permission name="internet" />
  30.         <permission name="bootCompleted" />
  31.         <permission name="hardware" />
  32. </widget>
复制代码


258
帖子
4
勋章
1024
Y币
回帖拿金币,支持支持
5
帖子
0
勋章
417
Y币
回帖拿金币,支持支持
15
帖子
0
勋章
444
Y币
感谢分享
68
帖子
2
勋章
288
Y币
早一点出来,福利很多人!
5
帖子
0
勋章
199
Y币
感觉分享,学习了!!!

回帖拿金币,支持支持
42
帖子
1
勋章
1万+
Y币
学习学习
99
帖子
1
勋章
314
Y币
帖拿金币,支持支持
75
帖子
0
勋章
822
Y币
是不是可以自己做一个动态图  ,也可以实现这样的效果
12345678910... 11下一页
您需要登录后才可以回帖 登录

本版积分规则