textarea

$('textarea').each(function () {
this.setAttribute('style', 'height:' + (this.scrollHeight) + 'px;overflow-y:hidden;');
}).on('input', function () {
this.style.height = 'auto';
this.style.height = (this.scrollHeight) + 'px';
});
posted @ 2018-01-26 15:34  漠漠~  阅读(152)  评论(0编辑  收藏  举报