[英]Auto resize textarea diagonally to fit content
我想對角自動調整我的textarea以適應內容。
我看到了一個jsfiddle演示,但textarea只是按高度調整大小。 是否可以對角自動調整大小?
試試這種方式
txt.on('keyup', function () {
content = $(this).val();
content = content.replace(/\n/g, '<br>');
hiddenDiv.html(content + '<br class="lbr">');
$(this).css('height', hiddenDiv.height()+50);
$(this).css('width', $(this).width()+50);
});
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.