layer⾃定义弹窗样式1.下载并引⽤js,
<link href="~/Scripts/layer/layer.css" rel="stylesheet" />
<script src="~/Scripts/jquery-1.10.2.min.js"></script>
<script src="~/Scripts/layer/layer.js"></script>
2.⾃定义样式
<style>
<!--样式1-->
body .demo-class {
background: url(/images/draw/pc_cj_open1.png) no-repeat;
border: none;
}
body .demo-class .layui-layer-content {
padding: 3rem 3rem 0 3rem;
text-align: center;
font-size: 1.2rem;
font-weight: bold;
height: 1px;
}
body .demo-class .layui-layer-btn {
margin-top: 0rem;
}
body .demo-class .layui-layer-btn a {
background: #ff6a00;
border: 0px;
}
body .demo-class .layui-layer-btn .layui-layer-btn1 {
background: #afb611;
border: 0px;
}
<!--样式2-->
body .winning-class {
background: url(/images/draw/pc_cj_open3.png) no-repeat;
border: none;
}
body .winning-class .layui-layer-content {
padding: 5rem 3rem 2rem 3rem;
text-align: center;
font-size: 1.2rem;
font-weight: bold;
height: 1px;
}
body .winning-class .layui-layer-btn {
margin-top: 1rem;
}
body .winning-class .layui-layer-btn a {
background: #ff6a00;
border: 0px;
}
body .winning-class .layui-layer-btn .layui-layer-btn1 {
background: #afb611;
border: 0px;
}
</style>
3.调⽤
<script>
/
/全局样式
skin: 'demo-class'//⾃定义样式demo-class
})
//当没有定义skin时使⽤的是全局样式
title:false,
btnAlign: 'c',
area: ['20rem', '12rem'],
btn: ['确定抽奖', '关闭'] //按钮
}, function(index){
layer.close(index);
StartGame();
});
layer.msg('提⽰信息123123', {
skin:'winning-class',//⾃定义样式winning-class
time:0,
title:false,
btnAlign: 'c',
area: ['20rem', '12rem']
layui下载
, btn: ['确定']
, yes: function (index) {
layer.close(index);
window.location.href=window.location.href;
}
});
</script>
好⽂要顶呀,兄弟们

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。