Javascript 物化文本区域是否不动态更改?
使用TextArea,class=“materialize TextArea”。 在的文档中,TextArea向下扩展并移动页面内容时不需要javaScript或jQuery 当我在文本区域内输入文本时,我无法按enter键向下移动。我只能沿着直线写到无穷远。这不是我想要的,显然,我想要的是文本区域在文本到达行的末尾时调整大小,但它没有。以前有人遇到过这个问题吗Javascript 物化文本区域是否不动态更改?,javascript,html,materialize,Javascript,Html,Materialize,使用TextArea,class=“materialize TextArea”。 在的文档中,TextArea向下扩展并移动页面内容时不需要javaScript或jQuery 当我在文本区域内输入文本时,我无法按enter键向下移动。我只能沿着直线写到无穷远。这不是我想要的,显然,我想要的是文本区域在文本到达行的末尾时调整大小,但它没有。以前有人遇到过这个问题吗 HTML: <div class="container" id="applyDiv"> <h4 class
HTML:
<div class="container" id="applyDiv">
<h4 class="header center green-text">APPLY FOR MEMBERSHIP</h4>
<div class="row">
<form class="col s12">
<div class="row">
<p class="light">
By submitting your company details you can get access to StoryTourist and create your own
customized stories for your audience to enjoy around the world!
</p>
<div class="input-field col s12">
<i class="material-icons prefix green-text">business</i>
<input placeholder="Company Name" type="text" class="validate">
</div>
<div class="input-field col s12">
<i class="material-icons prefix green-text">mail outline</i>
<input placeholder="Company e-mail" type="text" class="validate">
</div>
<div class="input-field col s12">
<i class="material-icons prefix green-text">phone</i>
<input placeholder="Company phone-number" type="text" class="validate">
</div>
<div class="input-field col s12">
<i class="material-icons prefix green-text">mode_edit</i>
<input placeholder="Message us..." textarea id="textArea1" class="materialize-textarea"></textarea>
</div>
</div>
</form>
</div>
<div class="row center padding-bottom-1">
<a class="btn-small green" id="sendButton">Submit details</a>
</div>
</div>
HTML:
申请会员资格
通过提交公司详细信息,您可以访问StoryTourism并创建自己的网站
为您的观众定制故事,让他们在世界各地欣赏!
商业
邮件大纲
电话
编辑模式
提交详细信息
更新
更改:
<input placeholder="Message us..." textarea id="textArea1" class="materialize-textarea"></textarea>
致:
现在面临的问题是页面不会随TextArea动态更改,我的CSS中没有固定高度。您需要更改此设置
<input placeholder="Message us..." textarea id="textArea1" class="materialize-textarea"></textarea>
对此
<textarea placeholder="Message us..." id="textArea1" class="materialize-textarea"></textarea>
这会解决你的问题。您使用
标记打开,但使用
标记关闭 我知道这已经很晚了,但是当你下载Materialize文件夹时-如果你想让它自动调整大小,Materialize使用javascript,所以你必须包括javascript文件和css文件我不明白你说的页面不随文本区域动态变化是什么意思,你能做一个代码笔吗?我的意思是,文本区域应该调整大小,以便您看到文本区域中的所有文本。现在,当我按enter键时,它会随着向上移动而消失。“提交”按钮和页脚应紧随其后,使页面高度随着文本的扩展而增大。不要以为我能给出比这更直接的答案:)我需要在家里复制这个问题,如果有人不帮你接这个,我下班回家后会看一看,因为不幸的是我仍然不理解这个问题。这很有帮助。谢谢:)
<textarea placeholder="Message us..." id="textArea1" class="materialize-textarea"></textarea>