mirror of https://github.com/layui/layer
upgrade
parent
4ea3f1dc9e
commit
4080d70cb3
|
@ -18,6 +18,6 @@ Thumbs.db
|
|||
node_modules/
|
||||
_site/
|
||||
.gitignore
|
||||
skin/seaning/
|
||||
src/skin/seaning/
|
||||
skin/moon/
|
||||
src/skin/moon/
|
||||
git/
|
30
CHANGELOG.md
30
CHANGELOG.md
|
@ -1,5 +1,33 @@
|
|||
|
||||
【1.9.0】
|
||||
【1.9.3】2015.05.23
|
||||
> 修复全局设置皮肤时,部分类型层未起作用的bug。
|
||||
> 增加skin值:layui-layer-rim,用于给层加边框(类似1.85的风格)
|
||||
> 样式微调
|
||||
|
||||
== 拓展模块 ==
|
||||
> 修复相册层设定基础参数时,只有首次有效的bug。
|
||||
|
||||
|
||||
【1.9.2】2015.05.08
|
||||
> 增加关闭动画样式:layui-layer-close
|
||||
> 优化默认弹出动画
|
||||
> 优化默认图标,默认的icon支持缩减到0-6(拓展皮肤可自己任意设定支持的数目)
|
||||
> 优化部分样式
|
||||
> 机智地修复了一个隐藏得非常深的但是不是太重要的bug。
|
||||
> 剔除了一些图片。
|
||||
|
||||
【1.9.1】2015.04.29
|
||||
> btn设定多个按钮时,新增对应的回调(支持只有yes和cancel回调),如btn: ['按钮一','按钮二','按钮三'],按钮一和按钮二还是之前的yes和cancel,按钮三,则回调为 btn3: function(){},以此类推。
|
||||
> 对cancel回调进行了微完善,如果不想关闭,return false即可,如cancel: function(){return false},取消则不会关闭。
|
||||
> 修复当设置了fix:false时,offset的设置无效的bug
|
||||
> 为低版本IE回收iframe占用的内存,从而修复偶尔无法获焦的bug
|
||||
> 修复当设置了btn时,最小化不能愉快地呈现的bug。
|
||||
> 修复全局设置skin时,某些层类型出现样式异常的bug。
|
||||
> 修复area设置了百分比时,maxmin参数无效的bug。
|
||||
> 完善当采用<script>合并路径的方式引入layer,加载了错误的css路径的问题。这种情况需在script标签上加一个自定义属性merge="true",然后通过layer.config({path: 'layer所在目录'})来完成初始化的配置
|
||||
> 样式微调
|
||||
|
||||
【1.9.0】2015.04.19
|
||||
|
||||
> 新增laye.open(options),抛弃了之前的$.layer(options)调用方法,目的是与layer mobile保持统一。
|
||||
> 新增layer.config(options)方法,用于进行全局化配置。除了用于展现弹层的基础参数外,还支持path,用于模块化加载layer时设定目录以便加载所需配件,如layer.config({path: '所在路径', extend: ''});
|
||||
|
|
|
@ -0,0 +1,58 @@
|
|||
module.exports = function(grunt) {
|
||||
|
||||
// Project configuration.
|
||||
grunt.initConfig({
|
||||
pkg: grunt.file.readJSON('package.json'),
|
||||
|
||||
//压缩js - layer
|
||||
uglify: {
|
||||
options: {
|
||||
expand: true
|
||||
},
|
||||
'layer.js': {
|
||||
options: {
|
||||
banner: '/*! layer-v<%= pkg.version %> <%= pkg.description %> License LGPL <%= pkg.homepage %> By <%= pkg.author %> */\n;'
|
||||
},
|
||||
src: './src/layer.js',
|
||||
dest: './layer.js'
|
||||
},
|
||||
'layer.ext.js': {
|
||||
options: {
|
||||
banner: '/*! layer<%= pkg.description %>拓展类 */\n;'
|
||||
},
|
||||
src: './src/extend/layer.ext.js',
|
||||
dest: './extend/layer.ext.js'
|
||||
},
|
||||
'layer.mobile.js': {
|
||||
options: {
|
||||
banner: '/*! layer mobile-v<%= pkg.mobile %> <%= pkg.description %>移动版 License LGPL <%= pkg.homepage %>mobile By <%= pkg.author %> */\n;'
|
||||
},
|
||||
src: './src/mobile/layer.m.js',
|
||||
dest: './mobile/layer.m.js'
|
||||
}
|
||||
},
|
||||
|
||||
//压缩css
|
||||
cssmin: {
|
||||
options : {
|
||||
compatibility : 'ie8', //设置兼容模式
|
||||
noAdvanced : true //取消高级特性
|
||||
}
|
||||
,layer: {
|
||||
files: [{
|
||||
expand: true,
|
||||
cwd: './src/skin',
|
||||
src: ['*.css', '!*.min.css'],
|
||||
dest: './skin'
|
||||
}]
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
grunt.loadNpmTasks('grunt-contrib-uglify');
|
||||
grunt.loadNpmTasks('grunt-contrib-cssmin');
|
||||
|
||||
grunt.registerTask('default', ['uglify', 'cssmin']);
|
||||
|
||||
|
||||
};
|
|
@ -1,2 +1,2 @@
|
|||
/*! layer弹层拓展类 */
|
||||
;layer.use("skin/layer.ext.css",function(){layer.layui_layer_extendlayerextjs=!0}),layer.prompt=function(a,b){a=a||{},"function"==typeof a&&(b=a);var c,d=2==a.formType?'<textarea class="layui-layer-input">'+(a.value||"")+"</textarea>":function(){return'<input type="'+(1==a.formType?"password":"text")+'" class="layui-layer-input" value="'+(a.value||"")+'">'}();return layer.open($.extend({btn:["确定","取消"],content:d,skin:"layui-layer-prompt",success:function(a){c=a.find(".layui-layer-input"),c.focus()},yes:function(d){var e=c.val();""===e?c.focus():e.length>(a.maxlength||500)?layer.tips("最多输入"+(a.maxlength||500)+"个字数",c,{tips:1}):b&&b(e,d,c)}},a))},layer.tab=function(a){a=a||{};var b=a.tab||{};return layer.open($.extend({type:1,skin:"layui-layer-tab",title:function(){var a=b.length,c=1,d="";if(a>0)for(d='<span class="layui-layer-tabnow">'+b[0].title+"</span>";a>c;c++)d+="<span>"+b[c].title+"</span>";return d}(),content:'<ul class="layui-layer-tabmain">'+function(){var a=b.length,c=1,d="";if(a>0)for(d='<li class="layui-layer-tabli xubox_tab_layer">'+(b[0].content||"no content")+"</li>";a>c;c++)d+='<li class="layui-layer-tabli">'+(b[c].content||"no content")+"</li>";return d}()+"</ul>",success:function(a){var b=a.find(".layui-layer-title").children(),c=a.find(".layui-layer-tabmain").children();b.on("mousedown",function(a){a.stopPropagation?a.stopPropagation():a.cancelBubble=!0;var b=$(this),d=b.index();b.addClass("layui-layer-tabnow").siblings().removeClass("layui-layer-tabnow"),c.eq(d).show().siblings().hide()})}},a))},layer.photos=function(a,b,c){function d(a,b,c){var d=new Image;d.onload=function(){d.onload=null,b(d)},d.onerror=function(a){d.onload=null,c(a)},d.src=a}var e={};if(a=a||{},a.photos){var f=a.photos.constructor===Object,g=f?a.photos:{},h=g.data||[],i=g.start||0;if(e.imgIndex=i+1,f){if(0===h.length)return void layer.msg("没有图片")}else{var j=$(a.photos),k=j.find(a.img||"img");if(0===k.length)return;if(b||j.find(g.img||"img").each(function(b){var c=$(this);h.push({alt:c.attr("alt"),pid:c.attr("layer-pid"),src:c.attr("layer-src")||c.attr("src"),thumb:c.attr("src")}),c.on("click",function(){layer.photos($.extend(a,{photos:{start:b,data:h,tab:a.tab},full:a.full}),!0)})}),!b)return}e.imgprev=function(a){e.imgIndex--,e.imgIndex<1&&(e.imgIndex=h.length),e.tabimg(a)},e.imgnext=function(a){e.imgIndex++,e.imgIndex>h.length&&(e.imgIndex=1),e.tabimg(a)},e.keyup=function(a){if(!e.end){var b=a.keyCode;a.preventDefault(),37===b?e.imgprev(!0):39===b?e.imgnext(!0):27===b&&layer.close(e.index)}},e.tabimg=function(b){g.start=e.imgIndex-1,layer.close(e.index),layer.photos({photos:g,full:a.full,tab:a.tab},!0,b)},e.event=function(){e.bigimg.hover(function(){e.imgsee.show()},function(){e.imgsee.hide()}),e.bigimg.find(".layui-layer-imgprev").on("click",function(a){a.preventDefault(),e.imgprev()}),e.bigimg.find(".layui-layer-imgnext").on("click",function(a){a.preventDefault(),e.imgnext()}),$(document).on("keyup",e.keyup)},e.loadi=layer.load(1,{shade:.9,scrollbar:!1}),d(h[i].src,function(b){layer.close(e.loadi),e.index=layer.open($.extend({type:1,area:function(){var c=[b.width,b.height],d=[$(window).width()-100,$(window).height()-100];return!a.full&&c[0]>d[0]&&(c[0]=d[0],c[1]=c[0]*d[1]/c[0]),[c[0]+"px",c[1]+"px"]}(),title:!1,shade:.9,shadeClose:!0,closeBtn:!1,move:".layui-layer-phimg img",moveType:1,scrollbar:!1,moveOut:!0,shift:5*Math.random()|0,skin:"layui-layer-photos",content:'<div class="layui-layer-phimg"><img src="'+h[i].src+'" alt="'+(h[i].alt||"")+'" layer-pid="'+h[i].pid+'"><div class="layui-layer-imgsee"><span class="layui-layer-imguide"><a href="javascript:;" class="layui-layer-iconext layui-layer-imgprev"></a><a href="javascript:;" class="layui-layer-iconext layui-layer-imgnext"></a></span><div class="layui-layer-imgbar" style="display:'+(c?"block":"")+'"><span class="layui-layer-imgtit"><a href="javascript:;">'+(h[i].alt||"")+"</a><em>"+e.imgIndex+"/"+h.length+"</em></span></div></div></div>",success:function(b){e.bigimg=b.find(".layui-layer-phimg"),e.imgsee=b.find(".layui-layer-imguide,.layui-layer-imgbar"),e.event(b),a.tab&&a.tab(h[i],b)},end:function(){e.end=!0,$(document).off("keyup",e.keyup)}},a))},function(){layer.close(e.loadi),layer.msg("当前图片地址异常",function(){h.length>1&&e.imgnext(!0)})})}};
|
||||
/*! layer弹层组件拓展类 */
|
||||
;!function(){layer.use("skin/layer.ext.css",function(){layer.layui_layer_extendlayerextjs=!0});var a=layer.cache,b=function(b){return a.skin?" "+a.skin+" "+a.skin+"-"+b:""};layer.prompt=function(a,c){a=a||{},"function"==typeof a&&(c=a);var d,e=2==a.formType?'<textarea class="layui-layer-input">'+(a.value||"")+"</textarea>":function(){return'<input type="'+(1==a.formType?"password":"text")+'" class="layui-layer-input" value="'+(a.value||"")+'">'}();return layer.open($.extend({btn:["确定","取消"],content:e,skin:"layui-layer-prompt"+b("prompt"),success:function(a){d=a.find(".layui-layer-input"),d.focus()},yes:function(b){var e=d.val();""===e?d.focus():e.length>(a.maxlength||500)?layer.tips("最多输入"+(a.maxlength||500)+"个字数",d,{tips:1}):c&&c(e,b,d)}},a))},layer.tab=function(a){a=a||{};var c=a.tab||{};return layer.open($.extend({type:1,skin:"layui-layer-tab"+b("tab"),title:function(){var a=c.length,b=1,d="";if(a>0)for(d='<span class="layui-layer-tabnow">'+c[0].title+"</span>";a>b;b++)d+="<span>"+c[b].title+"</span>";return d}(),content:'<ul class="layui-layer-tabmain">'+function(){var a=c.length,b=1,d="";if(a>0)for(d='<li class="layui-layer-tabli xubox_tab_layer">'+(c[0].content||"no content")+"</li>";a>b;b++)d+='<li class="layui-layer-tabli">'+(c[b].content||"no content")+"</li>";return d}()+"</ul>",success:function(a){var b=a.find(".layui-layer-title").children(),c=a.find(".layui-layer-tabmain").children();b.on("mousedown",function(a){a.stopPropagation?a.stopPropagation():a.cancelBubble=!0;var b=$(this),d=b.index();b.addClass("layui-layer-tabnow").siblings().removeClass("layui-layer-tabnow"),c.eq(d).show().siblings().hide()})}},a))},layer.photos=function(a,c,d){function e(a,b,c){var d=new Image;d.onload=function(){d.onload=null,b(d)},d.onerror=function(a){d.onload=null,c(a)},d.src=a}var f={};if(a=a||{},a.photos){var g=a.photos.constructor===Object,h=g?a.photos:{},i=h.data||[],j=h.start||0;if(f.imgIndex=j+1,g){if(0===i.length)return void layer.msg("没有图片")}else{var k=$(a.photos),l=k.find(a.img||"img");if(0===l.length)return;if(c||k.find(h.img||"img").each(function(b){var c=$(this);i.push({alt:c.attr("alt"),pid:c.attr("layer-pid"),src:c.attr("layer-src")||c.attr("src"),thumb:c.attr("src")}),c.on("click",function(){layer.photos($.extend(a,{photos:{start:b,data:i,tab:a.tab},full:a.full}),!0)})}),!c)return}f.imgprev=function(a){f.imgIndex--,f.imgIndex<1&&(f.imgIndex=i.length),f.tabimg(a)},f.imgnext=function(a){f.imgIndex++,f.imgIndex>i.length&&(f.imgIndex=1),f.tabimg(a)},f.keyup=function(a){if(!f.end){var b=a.keyCode;a.preventDefault(),37===b?f.imgprev(!0):39===b?f.imgnext(!0):27===b&&layer.close(f.index)}},f.tabimg=function(b){h.start=f.imgIndex-1,layer.close(f.index),layer.photos(a,!0,b)},f.event=function(){f.bigimg.hover(function(){f.imgsee.show()},function(){f.imgsee.hide()}),f.bigimg.find(".layui-layer-imgprev").on("click",function(a){a.preventDefault(),f.imgprev()}),f.bigimg.find(".layui-layer-imgnext").on("click",function(a){a.preventDefault(),f.imgnext()}),$(document).on("keyup",f.keyup)},f.loadi=layer.load(1,{shade:"shade"in a?!1:.9,scrollbar:!1}),e(i[j].src,function(c){layer.close(f.loadi),f.index=layer.open($.extend({type:1,area:function(){var b=[c.width,c.height],d=[$(window).width()-100,$(window).height()-100];return!a.full&&b[0]>d[0]&&(b[0]=d[0],b[1]=b[0]*d[1]/b[0]),[b[0]+"px",b[1]+"px"]}(),title:!1,shade:.9,shadeClose:!0,closeBtn:!1,move:".layui-layer-phimg img",moveType:1,scrollbar:!1,moveOut:!0,shift:5*Math.random()|0,skin:"layui-layer-photos"+b("photos"),content:'<div class="layui-layer-phimg"><img src="'+i[j].src+'" alt="'+(i[j].alt||"")+'" layer-pid="'+i[j].pid+'"><div class="layui-layer-imgsee"><span class="layui-layer-imguide"><a href="javascript:;" class="layui-layer-iconext layui-layer-imgprev"></a><a href="javascript:;" class="layui-layer-iconext layui-layer-imgnext"></a></span><div class="layui-layer-imgbar" style="display:'+(d?"block":"")+'"><span class="layui-layer-imgtit"><a href="javascript:;">'+(i[j].alt||"")+"</a><em>"+f.imgIndex+"/"+i.length+"</em></span></div></div></div>",success:function(b,c){f.bigimg=b.find(".layui-layer-phimg"),f.imgsee=b.find(".layui-layer-imguide,.layui-layer-imgbar"),f.event(b),a.tab&&a.tab(i[j],b)},end:function(){f.end=!0,$(document).off("keyup",f.keyup)}},a))},function(){layer.close(f.loadi),layer.msg("当前图片地址异常",{time:2e3},function(){i.length>1&&f.imgnext(!0)})})}}}();
|
|
@ -1,2 +1,2 @@
|
|||
/*! layer mobile-v1.5 弹层组件移动版 License LGPL http://sentsin.com/layui/layer/ By 贤心 */
|
||||
/*! layer mobile-v1.5 弹层组件移动版 License LGPL http://layer.layui.com/mobile By 贤心 */
|
||||
;!function(a){"use strict";var b="";b=b?b:document.scripts[document.scripts.length-1].src.match(/[\s\S]*\//)[0];var c=document,d="querySelectorAll",e="getElementsByClassName",f=function(a){return c[d](a)};document.head.appendChild(function(){var a=c.createElement("link");return a.href=b+"need/layer.css",a.type="text/css",a.rel="styleSheet",a.id="layermcss",a}());var g={type:0,shade:!0,shadeClose:!0,fixed:!0,anim:!0};a.ready={extend:function(a){var b=JSON.parse(JSON.stringify(g));for(var c in a)b[c]=a[c];return b},timer:{},end:{}};var h=0,i=["layermbox"],j=function(a){var b=this;b.config=ready.extend(a),b.view()};j.prototype.view=function(){var a=this,b=a.config,d=c.createElement("div");a.id=d.id=i[0]+h,d.setAttribute("class",i[0]+" "+i[0]+(b.type||0)),d.setAttribute("index",h);var g=function(){var a="object"==typeof b.title;return b.title?'<h3 style="'+(a?b.title[1]:"")+'">'+(a?b.title[0]:b.title)+'</h3><button class="layermend"></button>':""}(),j=function(){var a,c=(b.btn||[]).length;return 0!==c&&b.btn?(a='<span type="1">'+b.btn[0]+"</span>",2===c&&(a='<span type="0">'+b.btn[1]+"</span>"+a),'<div class="layermbtn">'+a+"</div>"):""}();if(b.fixed||(b.top=b.hasOwnProperty("top")?b.top:100,b.style=b.style||"",b.style+=" top:"+(c.body.scrollTop+b.top)+"px"),2===b.type&&(b.content='<i></i><i class="laymloadtwo"></i><i></i><div>'+(b.content||"")+"</div>"),d.innerHTML=(b.shade?"<div "+("string"==typeof b.shade?'style="'+b.shade+'"':"")+' class="laymshade"></div>':"")+'<div class="layermmain" '+(b.fixed?"":'style="position:static;"')+'><div class="section"><div class="layermchild '+(b.className?b.className:"")+" "+(b.type||b.shade?"":"layermborder ")+(b.anim?"layermanim":"")+'" '+(b.style?'style="'+b.style+'"':"")+">"+g+'<div class="layermcont">'+b.content+"</div>"+j+"</div></div></div>",!b.type||2===b.type){var l=c[e](i[0]+b.type),m=l.length;m>=1&&k.close(l[0].getAttribute("index"))}document.body.appendChild(d);var n=a.elem=f("#"+a.id)[0];setTimeout(function(){try{n.className=n.className+" layermshow"}catch(a){return}b.success&&b.success(n)},1),a.index=h++,a.action(b,n)},j.prototype.action=function(a,b){var c=this;if(a.time&&(ready.timer[c.index]=setTimeout(function(){k.close(c.index)},1e3*a.time)),a.title&&(b[e]("layermend")[0].onclick=function(){a.cancel&&a.cancel(),k.close(c.index)}),a.btn)for(var d=b[e]("layermbtn")[0].children,f=d.length,g=0;f>g;g++)d[g].onclick=function(){var b=this.getAttribute("type");0==b?(a.no&&a.no(),k.close(c.index)):a.yes?a.yes(c.index):k.close(c.index)};if(a.shade&&a.shadeClose){var h=b[e]("laymshade")[0];h.onclick=function(){k.close(c.index,a.end)},h.ontouchmove=function(){k.close(c.index,a.end)}}a.end&&(ready.end[c.index]=a.end)};var k={v:"1.5",index:h,open:function(a){var b=new j(a||{});return b.index},close:function(a){var b=f("#"+i[0]+a)[0];b&&(b.innerHTML="",c.body.removeChild(b),clearTimeout(ready.timer[a]),delete ready.timer[a],"function"==typeof ready.end[a]&&ready.end[a](),delete ready.end[a])},closeAll:function(){for(var a=c[e](i[0]),b=0,d=a.length;d>b;b++)k.close(0|a[0].getAttribute("index"))}};"function"==typeof define?define(function(){return k}):a.layer=k}(window);
|
|
@ -0,0 +1,23 @@
|
|||
{
|
||||
"name": "layer",
|
||||
"version": "1.9.3",
|
||||
"mobile": "1.5",
|
||||
"description": "弹层组件",
|
||||
"main": "",
|
||||
"scripts": {
|
||||
"test": "echo \"Error: no test specified\" && exit 1"
|
||||
},
|
||||
"repository": {
|
||||
"type": "",
|
||||
"url": ""
|
||||
},
|
||||
"author": "贤心",
|
||||
"homepage": "http://layer.layui.com/",
|
||||
"devDependencies": {
|
||||
"grunt": "*",
|
||||
"grunt-contrib-uglify": "*",
|
||||
"grunt-contrib-cssmin": "*",
|
||||
"grunt-css": "*"
|
||||
|
||||
}
|
||||
}
|
File diff suppressed because one or more lines are too long
|
@ -5,4 +5,4 @@
|
|||
@Author: 贤心
|
||||
@blog: sentsin.com
|
||||
|
||||
*/.layui-layer-iconext{background:url(default/icon-ext.png) no-repeat}html #layui_layer_skinlayerextcss{display:none;position:absolute;width:1989px}.layui-layer-prompt .layui-layer-input{display:block;width:220px;height:30px;margin:0 auto;line-height:30px;padding:0 5px;border:1px solid #ccc;box-shadow:1px 1px 5px rgba(0,0,0,.1) inset;color:#333}.layui-layer-prompt textarea.layui-layer-input{width:300px;height:100px;line-height:20px}.layui-layer-tab{box-shadow:1px 1px 50px rgba(0,0,0,.4)}.layui-layer-tab .layui-layer-title{padding-left:0;border-bottom:1px solid #ccc;background-color:#eee;overflow:visible}.layui-layer-tab .layui-layer-title span{position:relative;float:left;min-width:80px;max-width:260px;padding:0 20px;text-align:center;cursor:default;text-overflow:ellipsis;overflow:hidden;white-space:nowrap}.layui-layer-tab .layui-layer-title span.layui-layer-tabnow{height:36px;border-left:1px solid #ccc;border-right:1px solid #ccc;background-color:#fff;z-index:10}.layui-layer-tab .layui-layer-title span:first-child{border-left:none}.layui-layer-tabmain{line-height:24px;clear:both}.layui-layer-tabmain .layui-layer-tabli{display:none}.layui-layer-tabmain .layui-layer-tabli.xubox_tab_layer{display:block}.xubox_tabclose{position:absolute;right:10px;top:5px;cursor:pointer}.layui-layer-photos{-webkit-animation-duration:1s;animation-duration:1s;background:url(default/xubox_loading1.gif) center center no-repeat #000}.layui-layer-photos .layui-layer-content{overflow:hidden;text-align:center}.layui-layer-photos .layui-layer-phimg img{position:relative;width:100%;display:inline-block;*display:inline;*zoom:1;vertical-align:top}.layui-layer-imguide,.layui-layer-imgbar{display:none}.layui-layer-imgprev,.layui-layer-imgnext{position:absolute;top:50%;width:27px;_width:44px;height:44px;margin-top:-22px;outline:0;blr:expression(this.onFocus=this.blur())}.layui-layer-imgprev{left:10px;background-position:-5px -5px;_background-position:-70px -5px}.layui-layer-imgprev:hover{background-position:-33px -5px;_background-position:-120px -5px}.layui-layer-imgnext{right:10px;_right:8px;background-position:-5px -50px;_background-position:-70px -50px}.layui-layer-imgnext:hover{background-position:-33px -50px;_background-position:-120px -50px}.layui-layer-imgbar{position:absolute;left:0;bottom:0;width:100%;height:32px;line-height:32px;background-color:rgba(0,0,0,.8);background-color:#000\9;filter:Alpha(opacity=80);color:#fff;text-overflow:ellipsis;overflow:hidden;white-space:nowrap;font-size:0}.layui-layer-imgtit *{display:inline-block;*display:inline;*zoom:1;vertical-align:top;font-size:12px}.layui-layer-imgtit a{max-width:65%;text-overflow:ellipsis;overflow:hidden;white-space:nowrap;color:#fff}.layui-layer-imgtit a:hover{color:#fff;text-decoration:underline}.layui-layer-imgtit em{padding-left:10px}
|
||||
*/.layui-layer-imgbar,.layui-layer-imgtit a,.layui-layer-tab .layui-layer-title span{text-overflow:ellipsis;white-space:nowrap}.layui-layer-iconext{background:url(default/icon-ext.png) no-repeat}html #layui_layer_skinlayerextcss{display:none;position:absolute;width:1989px}.layui-layer-prompt .layui-layer-input{display:block;width:220px;height:30px;margin:0 auto;line-height:30px;padding:0 5px;border:1px solid #ccc;box-shadow:1px 1px 5px rgba(0,0,0,.1) inset;color:#333}.layui-layer-prompt textarea.layui-layer-input{width:300px;height:100px;line-height:20px}.layui-layer-tab{box-shadow:1px 1px 50px rgba(0,0,0,.4)}.layui-layer-tab .layui-layer-title{padding-left:0;border-bottom:1px solid #ccc;background-color:#eee;overflow:visible}.layui-layer-tab .layui-layer-title span{position:relative;float:left;min-width:80px;max-width:260px;padding:0 20px;text-align:center;cursor:default;overflow:hidden}.layui-layer-tab .layui-layer-title span.layui-layer-tabnow{height:36px;border-left:1px solid #ccc;border-right:1px solid #ccc;background-color:#fff;z-index:10}.layui-layer-tab .layui-layer-title span:first-child{border-left:none}.layui-layer-tabmain{line-height:24px;clear:both}.layui-layer-tabmain .layui-layer-tabli{display:none}.layui-layer-tabmain .layui-layer-tabli.xubox_tab_layer{display:block}.xubox_tabclose{position:absolute;right:10px;top:5px;cursor:pointer}.layui-layer-photos{-webkit-animation-duration:1s;animation-duration:1s;background:url(default/xubox_loading1.gif) center center no-repeat #000}.layui-layer-photos .layui-layer-content{overflow:hidden;text-align:center}.layui-layer-photos .layui-layer-phimg img{position:relative;width:100%;display:inline-block;*display:inline;*zoom:1;vertical-align:top}.layui-layer-imgbar,.layui-layer-imguide{display:none}.layui-layer-imgnext,.layui-layer-imgprev{position:absolute;top:50%;width:27px;_width:44px;height:44px;margin-top:-22px;outline:0;blr:expression(this.onFocus=this.blur())}.layui-layer-imgprev{left:10px;background-position:-5px -5px;_background-position:-70px -5px}.layui-layer-imgprev:hover{background-position:-33px -5px;_background-position:-120px -5px}.layui-layer-imgnext{right:10px;_right:8px;background-position:-5px -50px;_background-position:-70px -50px}.layui-layer-imgnext:hover{background-position:-33px -50px;_background-position:-120px -50px}.layui-layer-imgbar{position:absolute;left:0;bottom:0;width:100%;height:32px;line-height:32px;background-color:rgba(0,0,0,.8);background-color:#000\9;filter:Alpha(opacity=80);color:#fff;overflow:hidden;font-size:0}.layui-layer-imgtit *{display:inline-block;*display:inline;*zoom:1;vertical-align:top;font-size:12px}.layui-layer-imgtit a{max-width:65%;overflow:hidden;color:#fff}.layui-layer-imgtit a:hover{color:#fff;text-decoration:underline}.layui-layer-imgtit em{padding-left:10px;font-style:normal}
|
|
@ -6,10 +6,16 @@
|
|||
|
||||
*/
|
||||
|
||||
;!function(){
|
||||
|
||||
layer.use('skin/layer.ext.css', function(){
|
||||
layer.layui_layer_extendlayerextjs = true;
|
||||
});
|
||||
|
||||
var cache = layer.cache, skin = function(type){
|
||||
return (cache.skin ? (' ' + cache.skin + ' ' + cache.skin + '-'+type) : '');
|
||||
}
|
||||
|
||||
//仿系统prompt
|
||||
layer.prompt = function(options, yes){
|
||||
options = options || {};
|
||||
|
@ -20,7 +26,7 @@ layer.prompt = function(options, yes){
|
|||
return layer.open($.extend({
|
||||
btn: ['确定','取消'],
|
||||
content: content,
|
||||
skin: 'layui-layer-prompt',
|
||||
skin: 'layui-layer-prompt' + skin('prompt'),
|
||||
success: function(layero){
|
||||
prompt = layero.find('.layui-layer-input');
|
||||
prompt.focus();
|
||||
|
@ -43,7 +49,7 @@ layer.tab = function(options){
|
|||
var tab = options.tab || {};
|
||||
return layer.open($.extend({
|
||||
type: 1,
|
||||
skin: 'layui-layer-tab',
|
||||
skin: 'layui-layer-tab' + skin('tab'),
|
||||
title: function(){
|
||||
var len = tab.length, ii = 1, str = '';
|
||||
if(len > 0){
|
||||
|
@ -117,8 +123,6 @@ layer.photos = function(options, loop, key){
|
|||
layer.msg('没有图片');
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
|
||||
//上一张
|
||||
dict.imgprev = function(key){
|
||||
|
@ -157,11 +161,7 @@ layer.photos = function(options, loop, key){
|
|||
dict.tabimg = function(key){
|
||||
photos.start = dict.imgIndex - 1;
|
||||
layer.close(dict.index);
|
||||
layer.photos({
|
||||
photos: photos,
|
||||
full: options.full,
|
||||
tab: options.tab
|
||||
}, true, key);
|
||||
layer.photos(options, true, key);
|
||||
}
|
||||
|
||||
//一些动作
|
||||
|
@ -200,7 +200,7 @@ layer.photos = function(options, loop, key){
|
|||
};
|
||||
|
||||
dict.loadi = layer.load(1, {
|
||||
shade: 0.9,
|
||||
shade: 'shade' in options ? false : 0.9,
|
||||
scrollbar: false
|
||||
});
|
||||
|
||||
|
@ -226,7 +226,7 @@ layer.photos = function(options, loop, key){
|
|||
scrollbar: false,
|
||||
moveOut: true,
|
||||
shift: Math.random()*5|0,
|
||||
skin: 'layui-layer-photos',
|
||||
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 +'">'
|
||||
+'<div class="layui-layer-imgsee"><span class="layui-layer-imguide"><a href="javascript:;" class="layui-layer-iconext layui-layer-imgprev"></a><a href="javascript:;" class="layui-layer-iconext layui-layer-imgnext"></a></span><div class="layui-layer-imgbar" style="display:'+ (key ? 'block' : '') +'"><span class="layui-layer-imgtit"><a href="javascript:;">'+ (data[start].alt||'') +'</a><em>'+ dict.imgIndex +'/'+ data.length +'</em></span></div></div>'
|
||||
|
@ -243,8 +243,10 @@ layer.photos = function(options, loop, key){
|
|||
}, options));
|
||||
}, function(){
|
||||
layer.close(dict.loadi);
|
||||
layer.msg('当前图片地址异常', function(){
|
||||
layer.msg('当前图片地址异常', {time: 2000}, function(){
|
||||
data.length > 1 && dict.imgnext(true);
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
}();
|
||||
|
|
16
src/layer.js
16
src/layer.js
|
@ -1,6 +1,6 @@
|
|||
/*!
|
||||
|
||||
@Name:layer v1.9.2 弹层组件
|
||||
@Name:layer v1.9.3 弹层组件
|
||||
@Author:贤心
|
||||
@Site:http://layer.layui.com
|
||||
@License:LGPL
|
||||
|
@ -25,14 +25,14 @@ var $, win, ready = {
|
|||
|
||||
//默认内置方法。
|
||||
window.layer = {
|
||||
v: '1.9.2',
|
||||
v: '1.9.3',
|
||||
ie6: !!window.ActiveXObject&&!window.XMLHttpRequest,
|
||||
index: 0,
|
||||
path: ready.getPath,
|
||||
config: function(options, fn){
|
||||
var item = 0;
|
||||
options = options || {};
|
||||
ready.config = $.extend(ready.config, options);
|
||||
layer.cache = ready.config = $.extend(ready.config, options);
|
||||
layer.path = ready.config.path || layer.path;
|
||||
typeof options.extend === 'string' && (options.extend = [options.extend]);
|
||||
layer.use('skin/layer.css', (options.extend && options.extend.length > 0) ? (function loop(){
|
||||
|
@ -105,7 +105,8 @@ window.layer = {
|
|||
},
|
||||
|
||||
msg: function(content, options, end){ //最常用提示层
|
||||
var type = typeof options === 'function', skin = 'layui-layer-msg';
|
||||
var type = typeof options === 'function', rskin = ready.config.skin;
|
||||
var skin = (rskin ? rskin + ' ' + rskin + '-msg' : '')||'layui-layer-msg';
|
||||
var shift = doms.anim.length - 1;
|
||||
if(type) end = options;
|
||||
return layer.open($.extend({
|
||||
|
@ -117,12 +118,12 @@ window.layer = {
|
|||
closeBtn: false,
|
||||
btn: false,
|
||||
end: end
|
||||
}, type ? {
|
||||
}, (type && !ready.config.skin) ? {
|
||||
skin: skin + ' layui-layer-hui',
|
||||
shift: shift
|
||||
} : function(){
|
||||
options = options || {};
|
||||
if(options.icon === -1 || options.icon === undefined){
|
||||
if(options.icon === -1 || options.icon === undefined && !ready.config.skin){
|
||||
options.skin = skin + ' ' + (options.skin||'layui-layer-hui');
|
||||
}
|
||||
return options;
|
||||
|
@ -442,7 +443,8 @@ Class.pt.move = function(){
|
|||
if($(this).attr('move') === 'ok'){
|
||||
conf.ismove = true;
|
||||
conf.layero = $(this).parents('.'+ doms[0]);
|
||||
var xx = conf.layero.offset().left, yy = conf.layero.offset().top, ww = conf.layero.width() - 6, hh = conf.layero.height() - 6;
|
||||
var border = parseFloat(conf.layero.css('border-width'))*2;
|
||||
var xx = conf.layero.offset().left, yy = conf.layero.offset().top, ww = conf.layero.width() - 6 + border, hh = conf.layero.height() - 6 + border;
|
||||
if(!$('#layui-layer-moves')[0]){
|
||||
$('body').append('<div id="layui-layer-moves" class="layui-layer-moves" style="left:'+ xx +'px; top:'+ yy +'px; width:'+ ww +'px; height:'+ hh +'px; z-index:2147483584"></div>');
|
||||
}
|
||||
|
|
|
@ -116,7 +116,7 @@ html #layui_layer_skinlayercss{display:none; position: absolute; width:1989px;}
|
|||
.layui-layer-setwin .layui-layer-close2:hover{ background-position:-180px -44px; _background-position:-25px -55px;}
|
||||
|
||||
/* 按钮栏 */
|
||||
.layui-layer-btn{text-align:center; padding:10px 30px; pointer-events: auto;}
|
||||
.layui-layer-btn{text-align:center; padding:0 30px 10px; pointer-events: auto;}
|
||||
.layui-layer-btn a{height:30px; line-height:30px; margin:0 8px; padding:0 20px; background:#5FBFE7; color:#fff; font-size:14px; font-weight:bold; cursor:pointer; text-decoration: none;}
|
||||
.layui-layer-btn a:hover{opacity:0.9; text-decoration: none;}
|
||||
.layui-layer-btn a:active{opacity:0.7;}
|
||||
|
@ -132,16 +132,18 @@ html #layui_layer_skinlayercss{display:none; position: absolute; width:1989px;}
|
|||
.layui-layer-ico4{background-position:-191px 0;}
|
||||
.layui-layer-ico5{background-position:-239px 0;}
|
||||
.layui-layer-ico6{background-position:-287px 0;}
|
||||
.layui-layer-rim{border:6px solid #8D8D8D; border:6px solid rgba(0,0,0,.3); border-radius:5px; box-shadow: none;}
|
||||
.layui-layer-msg{min-width:170px; border-radius:3px; border:5px solid #8D8D8D; border:5px solid rgba(0,0,0,.4);}
|
||||
.layui-layer-msg .layui-layer-content .layui-layer-ico{top:10px}
|
||||
.layui-layer-hui{min-width:100px; background-color:#000; filter:alpha(opacity=60); background-color: rgba(0,0,0,0.6); color: #fff; border:none; }
|
||||
.layui-layer-hui{min-width:100px; background-color:#000; filter:alpha(opacity=60); background-color: rgba(0,0,0,0.6); color: #fff; border:none;}
|
||||
.layui-layer-hui .layui-layer-content{padding:12px 25px; text-align:center;}
|
||||
.layui-layer-dialog .layui-layer-padding{padding: 22px 20px 22px 65px; text-align: left;}
|
||||
.layui-layer-msg .layui-layer-padding{padding:17px 20px 17px 65px;}
|
||||
.layui-layer-page .layui-layer-content{position:relative; overflow:auto;}
|
||||
.layui-layer-page .layui-layer-btn,.layui-layer-iframe .layui-layer-btn{padding-top:10px;}
|
||||
.layui-layer-nobg{background:none;}
|
||||
.layui-layer-iframe .layui-layer-content{overflow:hidden;}
|
||||
.layui-layer-iframe iframe{width:100%;}
|
||||
.layui-layer-iframe iframe{display:block; width:100%;}
|
||||
.layui-layer-loading{border-radius:100%; background:none; box-shadow:none;}
|
||||
.layui-layer-loading .layui-layer-content{width:60px; height:24px; background:url(default/loading-0.gif) no-repeat;}
|
||||
.layui-layer-loading .layui-layer-loading1{width:37px; height:37px; background:url(default/loading-1.gif) no-repeat;}
|
||||
|
@ -158,12 +160,11 @@ html #layui_layer_skinlayercss{display:none; position: absolute; width:1989px;}
|
|||
.layui-layer-tips i.layui-layer-TipsL{right:-8px;}
|
||||
|
||||
/* skin */
|
||||
.layui-layer-lan[type="dialog"]{min-width:280px;}
|
||||
.layui-layer-lan .layui-layer-title{background:#4476A7; color:#fff; border: none;}
|
||||
.layui-layer-lan .layui-layer-btn{border-top:1px solid #E9E7E7}
|
||||
.layui-layer-lan .layui-layer-btn{padding:10px; text-align: right; border-top:1px solid #E9E7E7}
|
||||
.layui-layer-lan .layui-layer-btn a{background:#BBB5B5;}
|
||||
.layui-layer-lan .layui-layer-btn .layui-layer-btn1{background:#C9C5C5;}
|
||||
.layui-layer-molv .layui-layer-title{background:#009f95; color:#fff; border: none;}
|
||||
.layui-layer-molv .layui-layer-btn a{background:#009f95;}
|
||||
.layui-layer-molv .layui-layer-btn .layui-layer-btn1{background:#92B8B1;}
|
||||
|
||||
|
||||
|
|
|
@ -40,5 +40,5 @@ html #layui_layer_skinlayerextcss{display:none; position: absolute; width:1989px
|
|||
.layui-layer-imgtit *{display:inline-block; *display:inline; *zoom:1; vertical-align:top; font-size:12px;}
|
||||
.layui-layer-imgtit a{max-width:65%; text-overflow: ellipsis; overflow: hidden; white-space: nowrap; color:#fff;}
|
||||
.layui-layer-imgtit a:hover{color:#fff; text-decoration:underline;}
|
||||
.layui-layer-imgtit em{padding-left:10px;}
|
||||
.layui-layer-imgtit em{padding-left:10px; font-style: normal;}
|
||||
|
||||
|
|
Binary file not shown.
Before Width: | Height: | Size: 1.1 KiB |
Binary file not shown.
Before Width: | Height: | Size: 14 KiB |
|
@ -1,36 +0,0 @@
|
|||
/**
|
||||
|
||||
@Name: layer皮肤--seaning
|
||||
@Date: 2015.04.19
|
||||
@Author: 隐
|
||||
@blog: seaning.com
|
||||
@remark:
|
||||
1.新增flat风格图标,替换layer默认图标,新图标大小为48px;
|
||||
2.更改按钮位置,右对齐
|
||||
3.添加title的底部border
|
||||
|
||||
**/
|
||||
|
||||
html #layui_layer_skinseaningstylecss{display:none; position: absolute; width:1989px;}
|
||||
|
||||
body .layer-ext-seaning .layui-layer-title{background:#f6f6f6; color:#000; border: 1px #e7e7e7 solid;}
|
||||
body .layer-ext-seaning .layui-layer-content .layui-layer-ico{width:48px; height:48px;}
|
||||
|
||||
body .layer-ext-seaning .layui-layer-ico0{background:url(default.png) no-repeat 0 0;}
|
||||
body .layer-ext-seaning .layui-layer-ico1{background:url(default.png) no-repeat -48px 0;}
|
||||
body .layer-ext-seaning .layui-layer-ico2{background:url(default.png) no-repeat -96px 0;}
|
||||
body .layer-ext-seaning .layui-layer-ico3{background:url(default.png) no-repeat -144px 0;}
|
||||
body .layer-ext-seaning .layui-layer-ico4{background:url(default.png) no-repeat -192px 0;}
|
||||
body .layer-ext-seaning .layui-layer-ico5{background:url(default.png) no-repeat -240px 0;}
|
||||
body .layer-ext-seaning .layui-layer-ico6{background:url(default.png) no-repeat -288px 0;}
|
||||
body .layer-ext-seaning .layui-layer-ico7{background:url(default.png) no-repeat -336px 0;}
|
||||
body .layer-ext-seaning .layui-layer-ico8{background:url(default.png) no-repeat -384px 0;}
|
||||
body .layer-ext-seaning .layui-layer-ico9{background:url(default.png) no-repeat -432px 0;}
|
||||
body .layer-ext-seaning .layui-layer-ico10{background:url(default.png) no-repeat -480px 0;}
|
||||
body .layer-ext-seaning .layui-layer-ico11{background:url(default.png) no-repeat -528px 0;}
|
||||
body .layer-ext-seaning .layui-layer-ico12{background:url(default.png) no-repeat -576px 0;}
|
||||
body .layer-ext-seaning .layui-layer-ico13{background:url(default.png) no-repeat -624px 0;}
|
||||
body .layer-ext-seaning .layui-layer-setwin .layui-layer-close1 {width: 14px; height: 14px; background:url(close.png) no-repeat;}
|
||||
body .layer-ext-seaning .layui-layer-btn{border-top:1px #e9e9e9 solid;}
|
||||
body .layer-ext-seaning .layui-layer-padding{padding-top:28px;padding-left:74px;padding-bottom: 30px;}
|
||||
body .layer-ext-seaning .layui-layer-btn{padding:5px 0;text-align:right;}
|
Loading…
Reference in New Issue