layer.alert('内容')
layer.alert('内容', {
icon: 1,
skin: 'layer-ext-moon'
})
layer.confirm('您是如何看待前端开发?', {
btn: ['重要','奇葩']
},
function
(){
layer.msg('的确很重要', {icon: 1});
},
function
(){
layer.msg('也可以这样', {
time: 20000,
btn: ['明白了', '知道了']
});
});
layer.msg('玩命提示中');
layer.alert('墨绿风格,点击确认看深蓝', {
skin: 'layui-layer-molv'
,closeBtn: 0
},
function
(){
layer.alert('偶吧深蓝style', {
skin: 'layui-layer-lan'
,closeBtn: 0
,anim: 4
});
});
layer.open({
type: 1,
shade: false,
title: false,
content: $('.layer_notice'),
cancel:
function
(){
layer.msg('捕获就是从页面已经存在的元素上,包裹layer的结构', {time: 5000, icon:6});
}
});
layer.open({
type: 1,
skin: 'layui-layer-rim',
area: ['420px', '240px'],
content: 'html内容'
});
layer.open({
type: 1,
skin: 'layui-layer-demo',
closeBtn: 0,
anim: 2,
shadeClose: true,
content: '内容'
});
layer.tips('Hi,我是tips', '吸附元素选择器,如#id');
layer.open({
type: 2,
title: 'layer mobile页',
shadeClose: true,
shade: 0.8,
area: ['380px', '90%'],
content: 'mobile/'
});
layer.open({
type: 2,
title: false,
closeBtn: 0,
shade: [0],
area: ['340px', '215px'],
offset: 'rb',
time: 2000,
anim: 2,
content: ['test/guodu.html', 'no'],
end
:
function
(){
layer.open({
type: 2,
title: '很多时候,我们想最大化看,比如像这个页面。',
shadeClose: true,
shade: false,
maxmin: true,
area: ['893px', '600px'],
content: '
});
}
});
var
index = layer.load(0, {shade: false});
var
index = layer.load(1, {
shade: [0.1,'#fff']
});
layer.tips('我是另外一个tips,只不过我长得跟之前那位稍有些不一样。', '吸附元素选择器', {
tips: [1, '#3595CC'],
time: 4000
});
layer.prompt({title: '输入任何口令,并确认', formType: 1},
function
(pass, index){
layer.close(index);
layer.prompt({title: '随便写点啥,并确认', formType: 2},
function
(text, index){
layer.close(index);
layer.msg('演示完毕!您的口令:'+ pass +'<br>您最后写下了:'+text);
});
});
layer.tab({
area: ['600px', '300px'],
tab: [{
title: 'TAB1',
content: '内容1'
}, {
title: 'TAB2',
content: '内容2'
}, {
title: 'TAB3',
content: '内容3'
}]
});
$.getJSON('test/photos.json?v='+
new
Date
,
function
(json){
layer.photos({
photos: json
,anim: 5
});
});