弹窗左右居中,不然会有偏移
#ship_detail{
margin:0 auto;
}
// 弹出div
layer.open({
type: 1
,title: ['订单详情']
,btn: ['确认','关闭']//多个按钮直接用btn1/btn2/btn3...回调
,shade: 0 // 阴影透明度
,maxmin: true //开启最大化最小化按钮
,area: ['100', '500px'] // 弹窗大小
,skin: 'layui-layer-nobg' // 背景 【nobg:无色,molv:蓝色】
,content:$("#ship_detail")
,closeBtn: 0 // 关闭按钮
,shadeClose: true // 点击阴影关闭弹窗
,offset:['10%'] // 弹窗未知
,yes:function (index, layero) {//这里也可以用btn1替代yes
alert('确定按钮回调')
}, btn2 : function() {
alert('取消按钮回调')
}, btn3 : function() {
alert('按钮3回调')
},cancel: function(){
alert('右上角关闭按钮回调')
},end: function(){
alert('最后执行回调')
}
,success:function(e){
// 弹出执行
}
})
// 弹出页面
layer.open({
type: 2,
title: '巡店详情',
shadeClose: true,
shade: false,
maxmin: true, //开启最大化最小化按钮
area: ['100%', '100%'],
content: 'www.baidu.com?id=' + obj.data.id
});
提示弹窗
layer.msg(esg.msg, {shade: [0.2, '#000'], time: 800})