mui 等待动画loading mui.showLoading
显示加载框:mui.showLoading("正在加载..","div"); //加载文字和类型,plus环境中类型为div时强制以div方式显示
隐藏加载框:mui.hideLoading(callback);//隐藏后的回调函数
注意:
加载框只会显示一个,多次调用showLoading只会显示最后一次调用的内容。
- //扩展mui.showLoading
- (function($, window) {
- //显示加载框
- $.showLoading = function(message,type) {
- if ($.os.plus && type !== 'div') {
- $.plusReady(function() {
- plus.nativeUI.showWaiting(message);
- });
- } else {
- var html = '';
- html += '<i class="mui-spinner mui-spinner-white"></i>';
- html += '<p class="text">' + (message || "数据加载中") + '</p>';
- //遮罩层
- var mask=document.getElementsByClassName("mui-show-loading-mask");
- if(mask.length==0){
- mask = document.createElement('div');
- mask.classList.add("mui-show-loading-mask");
- document.body.appendChild(mask);
- mask.addEventListener("touchmove", function(e){e.stopPropagation();e.preventDefault();});
- }else{
- mask[0].classList.remove("mui-show-loading-mask-hidden");
- }
- //加载框
- var toast=document.getElementsByClassName("mui-show-loading");
- if(toast.length==0){
- toast = document.createElement('div');
- toast.classList.add("mui-show-loading");
- toast.classList.add('loading-visible');
- document.body.appendChild(toast);
- toast.innerHTML = html;
- toast.addEventListener("touchmove", function(e){e.stopPropagation();e.preventDefault();});
- }else{
- toast[0].innerHTML = html;
- toast[0].classList.add("loading-visible");
- }
- }
- };
- //隐藏加载框
- $.hideLoading = function(callback) {
- if ($.os.plus) {
- $.plusReady(function() {
- plus.nativeUI.closeWaiting();
- });
- }
- var mask=document.getElementsByClassName("mui-show-loading-mask");
- var toast=document.getElementsByClassName("mui-show-loading");
- if(mask.length>0){
- mask[0].classList.add("mui-show-loading-mask-hidden");
- }
- if(toast.length>0){
- toast[0].classList.remove("loading-visible");
- callback && callback();
- }
- }
- })(mui, window);
- /*----------------mui.showLoading---------------*/
- .mui-show-loading {
- position: fixed;
- padding: 5px;
- width: 120px;
- min-height: 120px;
- top: 45%;
- left: 50%;
- margin-left: -60px;
- background: rgba(0, 0, 0, 0.6);
- text-align: center;
- border-radius: 5px;
- color: #FFFFFF;
- visibility: hidden;
- margin:;
- z-index:;
- -webkit-transition-duration: .2s;
- transition-duration: .2s;
- opacity:;
- -webkit-transform: scale(0.9) translate(-50%, -50%);
- transform: scale(0.9) translate(-50%, -50%);
- -webkit-transform-origin: 0 0;
- transform-origin: 0 0;
- }
- .mui-show-loading.loading-visible {
- opacity:;
- visibility: visible;
- -webkit-transform: scale(1) translate(-50%, -50%);
- transform: scale(1) translate(-50%, -50%);
- }
- .mui-show-loading .mui-spinner{
- margin-top: 24px;
- width: 36px;
- height: 36px;
- }
- .mui-show-loading .text {
- line-height: 1.6;
- font-family: -apple-system-font,"Helvetica Neue",sans-serif;
- font-size: 14px;
- margin: 10px 0 0;
- color: #fff;
- }
- .mui-show-loading-mask {
- position: fixed;
- z-index:;
- top:;
- right:;
- left:;
- bottom:;
- }
- .mui-show-loading-mask-hidden{
- display: none !important;
- }
- mui.showLoading("正在加载..","div"); //加载文字和类型,plus环境中类型为div时强制以div方式显示
- mui.hideLoading(callback);//隐藏后的回调函数
mui 等待动画loading mui.showLoading的更多相关文章
- [Swift通天遁地]一、超级工具-(11)使用EZLoadingActivity制作Loading加载等待动画
★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★➤微信公众号:山青咏芝(shanqingyongzhi)➤博客园地址:山青咏芝(https://www.cnblogs. ...
- android image加载中等待动画
在布局中添加一个ImageViw和一个EditText. <ImageView android:id="@+id/loading_imageView_info" androi ...
- WPF 后台任务 等待动画 样例 && C# BackgroundWorker 详解
运行效果: 前台代码: <Window x :Class="Waiting.Window1" xmlns="http://schemas.microsoft.com ...
- WPF加载等待动画
原文:WPF加载等待动画 原文地址:https://www.codeproject.com/Articles/57984/WPF-Loading-Wait-Adorner 界面遮罩 <UserC ...
- salesforce 零基础学习(二十七)VF页面等待(loading)效果制作
进行查询的情况下,显示友好的等待效果可以让用户更好的了解目前的状态以及减少用户消极的等待,例如下图所示. VF提供了<apex:actionStatus>标签,,此标签用于显示一个AJAX ...
- MUI框架-03-自定义MUI控件样式
MUI框架-03-自定义MUI控件样式 开发请查阅:官方文档:http://dev.dcloud.net.cn/mui/ui/ 如何自定义MUI控件样式 mui 以 iOS 7的 UI 为基础,补充了 ...
- WPF 加载等待动画
原文:WPF 加载等待动画 版权声明:本文为博主原创文章,未经博主允许不得转载. https://blog.csdn.net/qq_29844879/article/details/80216587 ...
- cocos2d-x游戏开发(十五)游戏加载动画loading界面
个人原创,欢迎转载:http://blog.csdn.net/dawn_moon/article/details/11478885 这个资源加载的loading界面demo是在玩客网做逆转三国的时候随 ...
- Android 自定义动画 Loading
转自:http://my.oschina.net/janson2013/blog/118558 1.定义一个ImageView 定义一个ImageView是为了装载图片,其中的图片将被rotate用来 ...
随机推荐
- LeetCode dp专题
1. 动态规划的适用场景 动态规划常常适用于有重叠子问题和最优子结构性质的问题,动态规划方法所耗时间往往远少于朴素解法. 2. 动态规划的基本思想 动态规划背后的基本思想非常简单.大致上,若要解一个给 ...
- 8. Scala面向对象编程(高级部分)
8.1 静态属性和静态方法 8.1.1 静态属性-提出问题 有一群小孩在玩堆雪人,不时有新的小孩加入,请问如何知道现在共有多少人在玩?请使用面向对象的思想,编写程序解决 8.1.2 基本介绍 -Sca ...
- NETCore使用带有权限验证的Swagger
原文:NETCore使用带有权限验证的Swagger 文章目录 Swagger 什么是Swagger NuGet安装 Startup注册Swagger 设置默认首页打开Swagger 为接口添加注释 ...
- jQuery---jq基础了解(语法,特性),JQ和JS的区别对比,JQ和JS相互转换,Jquery的选择器(基础选择器,层级选择器,属性选择器),Jquery的筛选器(基本筛选器,表单筛选器),Jquery筛选方法
jQuery---jq基础了解(语法,特性),JQ和JS的区别对比,JQ和JS相互转换,Jquery的选择器(基础选择器,层级选择器,属性选择器),Jquery的筛选器(基本筛选器,表单筛选器),Jq ...
- js高频经典面试题总结
类型转换问题 console.log(null>=0); console.log(null<=0); console.log(null==0); console.log(undefined ...
- 11、多行文本最后一行显示省略号并截取文本字数(vue)
1.首先通过css实现多行文本显示省略号: { height: 45px; display: -webkit-box; -webkit-box-orient: vertical; -webkit-li ...
- OpenSessionInViewFilter 的配置及替代方案
OpenSessionInViewFilter 的配置及替代方案 博客分类: hibernate OpenSessionInViewFilter 的配置及替代方案 Spring 为我们提供了一个叫做 ...
- mac php thinkphp5 验证码报错 Call to undefined function think\captcha\imagettftext()
百度一下,是GD库里缺少了freetype支持,然后各种拓展的方法都试了半天,php-v里都生效了,phpinfo里还是不生效,原来是各种文章里都缺少了最关键的一步,修改Apache的配置(我使用的是 ...
- Linux开发环境配置大全
Linux开发环境配置 零章:通过xshell在linux上安装JDK8 壹章:通过xshell在linux上安装tomcat8 贰章:通过xshell在linux上安装mysql5.7(终极版) 叁 ...
- zabbix--CPU监控并告警
zabbix监控CPU超值则报警 由于默认没有 cpu 的使用率监控,需要添加一个监控项,通过 system.cpu.util[,,] 来进行配置 添加监控项 添加图形 添加触发器 展示图