From 980fadcc659a5e1cd3959e03a203e5107a9aaa81 Mon Sep 17 00:00:00 2001 From: fanyushun <723107234@qq.com> Date: Thu, 1 Nov 2018 09:04:35 +0800 Subject: [PATCH] =?UTF-8?q?loadingType:=201/4=E7=9A=84=E6=97=B6=E5=80=99?= =?UTF-8?q?=E4=B8=8D=E7=94=A8=E8=AE=BE=E7=BD=AEanim:=20false=EF=BC=8C?= =?UTF-8?q?=E4=BD=86=E6=98=AF=E6=AD=A4=E6=97=B6=E8=AE=BE=E7=BD=AEanim?= =?UTF-8?q?=E6=97=A0=E6=95=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 4 ++-- dist/mobile/layer.js | 2 +- index.html | 6 +++--- src/mobile/layer.js | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 15791d3..048f9f8 100644 --- a/README.md +++ b/README.md @@ -16,9 +16,9 @@ layer致力于打造国内最盛行的弹层组件,为web开发提供强劲动 ## 二次开发 主要是对移动版的 `layer` 增加一些自己需要的功能,[点击体验](https://fxss5201.github.io/layer/): 1. loading 增加了多种新的样式,只需要在原有的 `layer.open` 基础上参数上设置 `loadingType` 参数就可以调用新的 loading 样式 - * `loadingType: 1`:全页面的新 loading,引用此请设置 `anim: false`,否则会导致 loading 向左移动一下 + * `loadingType: 1`:全页面的新 loading,引用此设置参数 `anim` 无效 * `loadingType: 2`:全页面的 loading 成功样式 * `loadingType: 3`:全页面的 loading 失败样式 - * `loadingType: 4`:小区域的新 loading,引用此请设置 `anim: false`,否则会导致 loading 向左移动一下 + * `loadingType: 4`:小区域的新 loading,引用此设置参数 `anim` 无效 * `loadingType: 5`:小区域的 loading 成功样式 * `loadingType: 6`:小区域的 loading 失败样式 \ No newline at end of file diff --git a/dist/mobile/layer.js b/dist/mobile/layer.js index 87d189a..11eab4c 100644 --- a/dist/mobile/layer.js +++ b/dist/mobile/layer.js @@ -1,2 +1,2 @@ /*! layer mobile-v2.0.0 Web弹层组件 MIT License http://layer.layui.com/mobile By 贤心 */ - ;!function(e){"use strict";var t=document,n="querySelectorAll",i="getElementsByClassName",a=function(e){return t[n](e)},l={type:0,shade:!0,shadeClose:!0,fixed:!0,anim:"scale",loadingType:0},s={extend:function(e){var t=JSON.parse(JSON.stringify(l));for(var n in e)t[n]=e[n];return t},timer:{},end:{}};s.touch=function(e,t){e.addEventListener("click",function(e){t.call(this,e)},!1)};var r=0,o=["layui-m-layer"],d=function(e){var t=this;t.config=s.extend(e),t.view()};d.prototype.view=function(){var e=this,n=e.config,l=t.createElement("div");e.id=l.id=o[0]+r,l.setAttribute("class",o[0]+" "+o[0]+(n.type||0)),l.setAttribute("index",r);var s=function(){var e="object"==typeof n.title;return n.title?'

'+(e?n.title[0]:n.title)+"

":""}(),d=function(){"string"==typeof n.btn&&(n.btn=[n.btn]);var e,t=(n.btn||[]).length;return 0!==t&&n.btn?(e=''+n.btn[0]+"",2===t&&(e=''+n.btn[1]+""+e),'
'+e+"
"):""}();if(n.fixed||(n.top=n.hasOwnProperty("top")?n.top:100,n.style=n.style||"",n.style+=" top:"+(t.body.scrollTop+n.top)+"px"),2===n.type)if(0===n.loadingType)n.content='

'+(n.content||"")+"

";else{var y="";(1===n.loadingType||4===n.loadingType)&&(y="layui-m-layerload-type1"),(2===n.loadingType||5===n.loadingType)&&(y="layui-m-layerload-type2"),(3===n.loadingType||6===n.loadingType)&&(y="layui-m-layerload-type3"),n.content='

'+(n.content||"")+"

"}if(n.skin&&(n.anim="up"),"msg"===n.skin&&(n.shade=!1),l.innerHTML=(n.shade?"
':"")+'
3?"layui-m-layerchild-transparent":"")+'" '+(n.style?'style="'+n.style+'"':"")+">"+s+'
'+n.content+"
"+d+"
",!n.type||2===n.type){var c=t[i](o[0]+n.type),u=c.length;u>=1&&layer.close(c[0].getAttribute("index"))}document.body.appendChild(l);var p=e.elem=a("#"+e.id)[0];n.success&&n.success(p),e.index=r++,e.action(n,p)},d.prototype.action=function(e,t){var n=this;e.time&&(s.timer[n.index]=setTimeout(function(){layer.close(n.index)},1e3*e.time));var a=function(){var t=this.getAttribute("type");0==t?(e.no&&e.no(),layer.close(n.index)):e.yes?e.yes(n.index):layer.close(n.index)};if(e.btn)for(var l=t[i]("layui-m-layerbtn")[0].children,r=l.length,o=0;o'+(e?n.title[0]:n.title)+"":""}(),d=function(){"string"==typeof n.btn&&(n.btn=[n.btn]);var e,t=(n.btn||[]).length;return 0!==t&&n.btn?(e=''+n.btn[0]+"",2===t&&(e=''+n.btn[1]+""+e),'
'+e+"
"):""}();if(n.fixed||(n.top=n.hasOwnProperty("top")?n.top:100,n.style=n.style||"",n.style+=" top:"+(t.body.scrollTop+n.top)+"px"),2===n.type)if(0===n.loadingType)n.content='

'+(n.content||"")+"

";else{var y="";1!==n.loadingType&&4!==n.loadingType||(y="layui-m-layerload-type1",n.anim=!1),(2===n.loadingType||5===n.loadingType)&&(y="layui-m-layerload-type2"),(3===n.loadingType||6===n.loadingType)&&(y="layui-m-layerload-type3"),n.content='

'+(n.content||"")+"

"}if(n.skin&&(n.anim="up"),"msg"===n.skin&&(n.shade=!1),l.innerHTML=(n.shade?"
':"")+'
3?"layui-m-layerchild-transparent":"")+'" '+(n.style?'style="'+n.style+'"':"")+">"+s+'
'+n.content+"
"+d+"
",!n.type||2===n.type){var c=t[i](o[0]+n.type),u=c.length;u>=1&&layer.close(c[0].getAttribute("index"))}document.body.appendChild(l);var p=e.elem=a("#"+e.id)[0];n.success&&n.success(p),e.index=r++,e.action(n,p)},d.prototype.action=function(e,t){var n=this;e.time&&(s.timer[n.index]=setTimeout(function(){layer.close(n.index)},1e3*e.time));var a=function(){var t=this.getAttribute("type");0==t?(e.no&&e.no(),layer.close(n.index)):e.yes?e.yes(n.index):layer.close(n.index)};if(e.btn)for(var l=t[i]("layui-m-layerbtn")[0].children,r=l.length,o=0;o 手机版测试 - +