rows也可以在隐藏前看一下scrollHeight
解决方案 »
- 页面报javax.servlet.ServletException: Request[/policyrevert] does not contain handl
- 关于window.open()使用之后的问题,请教高手
- 关于客户端中文的验证
- 用div做的tab的问题???
- [真诚求助]下拉框 OnChange执行函数的问题
- 高分送 200 好好ajax,送分!送分!送分!送分!送分!送分!
- 正则表达式
- javascript能否在页面以外的地方保存变量值
- 求助!!!如何让菜单盖住(下拉列表框) Select
- 请高手实现以下功能,高分奉送!在线等待.....
- 大家帮我看看js错在哪里1
- 我用XMLHTTP在客户端下载网页时,老是出现一个提示框,能不能把这个框去掉?50分
不知道这样行不行
objTextarea.value.replace(/[^\n]/mg,'').length;
<style>
.textareaWidthoutBorder
{
height : expression(this.scrollHeight+5);
overflow : hidden;
}</style></head><body bgcolor=efefef>
<table bgcolor=ccccc width=300 >
<tr>
<td>
<textarea class=textareaWidthoutBorder style="width:100%" readOnly >将内容忠实显示
与Pre的区别是内容过多,则会自动折行
fdsafdas
fdsaf
折行折行折行折行折行折行折行折行折行折行折行折行折行折行折行折行折行折行折行折行折行折行
fdsa</textarea></td>
</tr>
</table>
</body>
可以设置最大高度和最小高度, 超过设定最大高度则自动出现滚动条。<style>
textarea.autoHeight{
height : expression(scrollHeight+4<minH ? minH : Math.min(scrollHeight+4,maxH));
overflow : auto;
}
</style>
<textarea class=autoHeight style="width:500" minH="60" maxH="200">
</textarea>