根据内容调整所有textareas的大小

时间:2021-01-10 15:31:58

How can I resize all 'textarea' elements in my page according to the content inside and independent of one another?

如何根据内部的内容并相互独立地调整页面中所有“textarea”元素的大小?

So far I have tried using the following methods: Creating a textarea with auto-resize - which only resizes the first textarea and Resize text area to fit all text on load jquery - which resizes all the textareas to the same height, rather than according to content.

到目前为止,我尝试使用以下方法:使用自动调整大小创建一个textarea - 它只调整第一个textarea和Resize文本区域的大小以适应加载jquery上的所有文本 - 它将所有textareas调整为相同的高度,而不是根据内容。

1 个解决方案

#1


2  

Take a look at this http://www.jacklmoore.com/autosize/. It applies for each textarea to increase the height automatically based on the content you have in the textarea. And you can search for auto grow text area jquery plugin in google. you get plenty of plugins that full fill your requirement

看看这个http://www.jacklmoore.com/autosize/。它适用于每个textarea根据您在textarea中的内容自动增加高度。您可以在谷歌搜索自动增长文本区域jquery插件。你有足够的插件来满足你的要求

#1


2  

Take a look at this http://www.jacklmoore.com/autosize/. It applies for each textarea to increase the height automatically based on the content you have in the textarea. And you can search for auto grow text area jquery plugin in google. you get plenty of plugins that full fill your requirement

看看这个http://www.jacklmoore.com/autosize/。它适用于每个textarea根据您在textarea中的内容自动增加高度。您可以在谷歌搜索自动增长文本区域jquery插件。你有足够的插件来满足你的要求