我必须创建一个文本区域,根据文本扩展。 文本区域最小化为原始大小的问题(我不希望发生这种情况)。展开文本区域 - 模糊事件文本区域最小化到其原始大小
这是扩大代码:(它是从一个precvious问题采取)
$('texterea').keyup(function(e){
if($(this).outerHeight() < this.scrollHeight + parseFloat($(this).css("borderTopWidth")) + parseFloat($(this).css("borderBottomWidth"))) { while($(this).outerHeight() < this.scrollHeight + parseFloat($(this).css("borderTopWidth")) + parseFloat($(this).css("borderBottomWidth"))) { $(this).height($(this).height()+1); }; } else { while(!($(this).outerHeight() < this.scrollHeight + parseFloat($(this).css("borderTopWidth")) + parseFloat($(this).css("borderBottomWidth")))) { $(this).height($(this).height()-1); };
的HTML:
<g:form action="reply" id="${conversationInstance.id}">
<div class="convo-body">
<textarea class="reply input-text-big" rows="1" name="message" placeholder="Send a reply"></textarea>
</div>
<div class="mt-16">
<button type="submit" class="pull-right button-blue" disabled>Send</button>
</div>
</g:form>
哇。也许格式化一点。而且要更清楚你在问什么。包括您的HTML或小提琴 – Ted 2015-04-02 13:51:21