定制easyui控件方法messager.alert的窗口大小和滚动条

有时前端需要显示WebApi传过来的大段消息(比如异常信息等),使用easyui控件$.messager.alert()就不太合适了。有如下方法定制该控件的大小和滚动条,见代码:

$.messager.alert('提示', message, '').window({ width: 500, height: 300 });
$.messager.alert
({
	title: '提示',
	msg: '<div style="height:100px;">' + message + '</div>',
	width: 420
})

上述第一段代码,定制了消息窗口的长宽大小,但显示大段消息时效果还是不太好。第二段代码,既定制了消息窗口宽度(420),也定制了消息内容的高度(100px),并且显示大段消息时自动出现纵向滚动条,效果良好。

猜你喜欢

转载自blog.csdn.net/hulihui/article/details/82354033