update layer

This commit is contained in:
sentsin 2017-03-06 18:36:45 +08:00
parent c14117bf84
commit 99083dd4af
5 changed files with 34 additions and 21 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -200,7 +200,7 @@ a cite{font-style: normal; *cursor:pointer;}
.layui-select-disabled .layui-disabled{border-color: #eee !important;}
.layui-select-disabled .layui-edge{border-top-color: #d2d2d2}
/* 复选框 */.layui-form-checkbox{position: relative; display: inline-block; vertical-align: middle; height: 30px; line-height: 28px; margin: 4px 10px 0 0; padding-right: 30px; border: 1px solid #d2d2d2; background-color: #fff; cursor: pointer; font-size: 0; border-radius: 2px; -webkit-transition: .1s linear; transition: .1s linear; box-sizing: border-box !important;}
/* 复选框 */.layui-form-checkbox{position: relative; display: inline-block; vertical-align: middle; height: 30px; line-height: 28px; margin-right: 10px; padding-right: 30px; border: 1px solid #d2d2d2; background-color: #fff; cursor: pointer; font-size: 0; border-radius: 2px; -webkit-transition: .1s linear; transition: .1s linear; box-sizing: border-box !important;}
.layui-form-checkbox:hover{border: 1px solid #c2c2c2;}
.layui-form-checkbox *{display: inline-block; vertical-align: middle;}
.layui-form-checkbox span{padding: 0 10px; height: 100%; font-size: 14px; background-color: #d2d2d2; color: #fff; overflow: hidden; white-space: nowrap; text-overflow: ellipsis;}
@ -210,14 +210,16 @@ a cite{font-style: normal; *cursor:pointer;}
.layui-form-checked, .layui-form-checked:hover{border-color: #5FB878;}
.layui-form-checked span, .layui-form-checked:hover span{background-color: #5FB878;}
.layui-form-checked i, .layui-form-checked:hover i{color: #5FB878;}
.layui-form-item .layui-form-checkbox{margin-top: 4px;}
/* 复选框-原始风格 */.layui-form-checkbox[lay-skin="primary"]{margin-top: 6px; border: none!important; padding-right: 0; background: none;}
.layui-form-checkbox[lay-skin="primary"] span{float: right; background: none; color: #666;}
/* 复选框-原始风格 */.layui-form-checkbox[lay-skin="primary"]{height: auto!important; line-height: normal!important; border: none!important; margin-right: 0; padding-right: 0; background: none;}
.layui-form-checkbox[lay-skin="primary"] span{float: right; padding-right: 15px; line-height: 18px; background: none; color: #666;}
.layui-form-checkbox[lay-skin="primary"] i{position: relative; top: 0; width: 16px; line-height: 16px; border: 1px solid #d2d2d2; font-size: 12px; border-radius: 2px; background-color: #fff; -webkit-transition: .1s linear; transition: .1s linear;}
.layui-form-checkbox[lay-skin="primary"]:hover i{border-color: #5FB878; color: #fff;}
.layui-form-checked[lay-skin="primary"] i{border-color: #5FB878; background-color: #5FB878; color: #fff;}
.layui-checkbox-disbaled[lay-skin="primary"] span{background: none!important;}
.layui-checkbox-disbaled[lay-skin="primary"]:hover i{border-color: #d2d2d2;}
.layui-form-item .layui-form-checkbox[lay-skin="primary"]{margin-top: 10px;}
/* 复选框-开关风格 */.layui-form-switch{position: relative; display: inline-block; vertical-align: middle; height: 22px; line-height: 22px; width: 42px; padding: 0 5px; margin-top: 8px; border: 1px solid #d2d2d2; border-radius: 20px; cursor: pointer; background-color: #fff; -webkit-transition: .1s linear; transition: .1s linear;}
.layui-form-switch i{position: absolute; left: 5px; top: 3px; width: 16px; height: 16px; border-radius: 20px; background-color: #d2d2d2; -webkit-transition: .1s linear; transition: .1s linear;}

View File

@ -1,6 +1,6 @@
/**
@Namelayer v3.0.2 Web弹层组件
@Namelayer v3.0.3 Web弹层组件
@Author贤心
@Sitehttp://layer.layui.com
@LicenseMIT
@ -26,7 +26,7 @@ var isLayui = window.layui && layui.define, $, win, ready = {
//默认内置方法。
var layer = {
v: '3.0.2',
v: '3.0.3',
ie: function(){ //ie版本
var agent = navigator.userAgent.toLowerCase();
return (!!window.ActiveXObject || "ActiveXObject" in window) ? (
@ -83,7 +83,7 @@ var layer = {
},
ready: function(callback){
var cssname = 'skinlayercss', ver = '302';
var cssname = 'skinlayercss', ver = '303';
isLayui ? layui.addcss('modules/layer/default/layer.css?v='+layer.v+ver, callback, cssname)
: layer.link('skin/default/layer.css?v='+layer.v+ver, callback, cssname);
return this;
@ -167,11 +167,9 @@ var Class = function(setings){
var that = this;
that.index = ++layer.index;
that.config = $.extend({}, that.config, ready.config, setings);
layer.ready(function(){
document.body ? that.creat() : setTimeout(function(){
that.creat();
}, 50);
});
document.body ? that.creat() : setTimeout(function(){
that.creat();
}, 30);
};
Class.pt = Class.prototype;
@ -194,6 +192,7 @@ Class.pt.config = {
zIndex: 19891014,
maxWidth: 360,
anim: 0,
isOutAnim: true,
icon: -1,
moveType: 1,
resize: true,
@ -327,8 +326,13 @@ Class.pt.creat = function(){
//为兼容jQuery3.0的css动画影响元素尺寸计算
if(doms.anim[config.anim]){
that.layero.addClass(doms.anim[config.anim]).data('anim', true);
that.layero.addClass(doms.anim[config.anim]);
};
//记录关闭动画
if(config.isOutAnim){
that.layero.data('isOutAnim', true);
}
};
//自适应
@ -346,7 +350,7 @@ Class.pt.auto = function(index){
var btnHeight = layero.find('.'+doms[6]).outerHeight() || 0;
function setHeight(elem){
elem = layero.find(elem);
elem.height(area[1] - titHeight - btnHeight - 2*(parseFloat(elem.css('padding'))|0));
elem.height(area[1] - titHeight - btnHeight - 2*(parseFloat(elem.css('padding-top'))|0));
}
switch(config.type){
case 2:
@ -892,7 +896,7 @@ layer.close = function(index){
delete ready.end[index];
};
if(layero.data('anim')){
if(layero.data('isOutAnim')){
layero.addClass(closeAnim);
}
@ -903,9 +907,14 @@ layer.close = function(index){
ready.minIndex--;
ready.minLeft.push(layero.attr('minLeft'));
}
setTimeout(function(){
remove();
}, ((layer.ie && layer.ie < 10) || !layero.data('anim')) ? 0 : 200);
if((layer.ie && layer.ie < 10) || !layero.data('isOutAnim')){
remove()
} else {
setTimeout(function(){
remove();
}, 200);
}
};
//关闭所有层
@ -1113,6 +1122,7 @@ layer.photos = function(options, loop, key){
if(data.length <= 1) return;
photos.start = dict.imgIndex - 1;
layer.close(dict.index);
return layer.photos(options, true, key);
setTimeout(function(){
layer.photos(options, true, key);
}, 200);
@ -1192,7 +1202,8 @@ layer.photos = function(options, loop, key){
moveType: 1,
scrollbar: false,
moveOut: true,
anim: Math.random()*5|0,
//anim: Math.random()*5|0,
isOutAnim: false,
skin: 'layui-layer-photos' + skin('photos'),
content: '<div class="layui-layer-phimg">'
+'<img src="'+ data[start].src +'" alt="'+ (data[start].alt||'') +'" layer-pid="'+ data[start].pid +'">'