//回显内容的自适应
$("textarea.form-control").each(function (i, e) {
e.style.height = e.scrollHeight + 'px'
})
//输入内容的自适应
$(".e-c-form-horizontal").on("keydown", "textarea.form-control", function () {
setTimeout(function () {
$("textarea.form-control").each(function (i, e) {
e.style.height = e.scrollHeight + 'px'
})
}, 100)
})
textarea 根据内容自动调整高度
最新推荐文章于 2024-07-17 15:26:15 发布