将输入文本更改为textarea就像在Facebook中 [英] changing input text to textarea just like in facebook

查看:86
本文介绍了将输入文本更改为textarea就像在Facebook中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想复制您看到一个常规的输入文本,当您单击它更改为textarea。
这是一个隐藏层,还是实际上改变了textarea的输入?如何做呢?

解决方案

我相信它总是一个textarea和焦点,只是改变textarea的高度。 / p>

编辑:是的。他们使用脚本来处理一个textarea,没有输入字段。

 < textarea onfocus ='CSS.addClass c4b900e3aebfdd6a671453,UIComposer_STATE_INPUT_FOCUSED); CSS.removeClass(c4b900e3aebfdd6a671453_buttons,hidden_​​elem); window.UIComposer& amp; amp; UIComposer.focusInstance(c4b900e3aebfdd6a671453);'id =c4b900e3aebfdd6a671453_inputclass =UIComposer_TextArea DOMControl_placeholdername =statustitle =你在想什么? placeholder =你在想什么?> 
你在想什么?
< / textarea>


i would like to replicate that you see a regular input text and when you click it changes into textarea. is this a hidden layer or is it actually changing the input to textarea? how to do it?

解决方案

I do believe it's always a textarea and on focus they just change the height of the textarea.

Edit: yes, it is. They use scripting to do everything with a textarea, there is no input field.

<textarea onfocus='CSS.addClass("c4b900e3aebfdd6a671453", "UIComposer_STATE_INPUT_FOCUSED");CSS.removeClass("c4b900e3aebfdd6a671453_buttons", "hidden_elem");window.UIComposer &amp;&amp; UIComposer.focusInstance("c4b900e3aebfdd6a671453");' id="c4b900e3aebfdd6a671453_input" class="UIComposer_TextArea DOMControl_placeholder" name="status" title="What's on your mind?" placeholder="What's on your mind?">
What's on your mind?
</textarea>

这篇关于将输入文本更改为textarea就像在Facebook中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆