王新阳

wangxinyang

layui.layer宽度自适应

maxWidth当area属性为auto时有效

layer.open({
	skin: 'layui-layer-admin',
	title:"弹层标题",
	type: 1,
	maxmin: true,
	area: ['auto','90%'],
	maxWidth:1200,
	shadeClose: true,
	content: html
});

设置百分比宽度,打开弹层后重置最大宽度和位置,实现宽度自适应

layer.open({
	skin: 'layui-layer-admin',
	title:'标题',
	type: 1,
	maxmin: true,
	area: ['90%','90%'],
	shadeClose: true,
	content: html,
	success:function(layero,index,that){
		layer.style(index,{maxWidth:1200});
		that.offset();
	}
});
2024-08-03
2024-11-22 星期五 农历十月二十二