两种方法可以实现
1.第一种
layer.open({
type : 2,
title : ['重大报告', 'color:#fff;background-color:#2db7f5;'],
maxmin : true,
area : ['100%', '100%'],
content : "xxx.do?",
});
//area 属性的两个参数都写成 '100%'
2.第二种
var toIndex = layer.open({
type : 2,
title : ['重大报告', 'color:#fff;background-color:#2db7f5;'],
maxmin : true,
area : ['500px', '500px'],
content : "xxx.do?",
});
layer.full(toIndex);
//打开弹窗后 调用layer.full(Index) 方法,实现最大化
个人推荐 使用第二种
本文介绍了在层叠样式表(CSS)中通过layer插件实现弹窗最大化的两种方法。第一种方法直接设置area属性为'100%','100%',第二种方法则是先设置固定大小,然后调用layer.full()方法实现最大化。作者推荐使用第二种方法,因为它提供了更好的控制和灵活性。
591

被折叠的 条评论
为什么被折叠?



