textarea控制问题,请熟悉的 人帮看一下
onpropertychange= "this.style.posHeight=this.scrollHeight "
我用这个 输入时可以自适应大小
但是用数据库调用的值的时候 他就出现上下拉框了,我想全显示出来不需要上下拉,根据内容自适应大小。。
不知道怎么做。。
------解决方案-------------------- <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN ">
<HTML>
<HEAD>
<TITLE> New Document </TITLE>
<META NAME= "Generator " CONTENT= "EditPlus ">
<META NAME= "Author " CONTENT= " ">
<META NAME= "Keywords " CONTENT= " ">
<META NAME= "Description " CONTENT= " ">
</HEAD>
<body onload= "loadHeight(); ">
<textarea id= "t1 " onpropertychange= "loadHeight(); "> </textarea>
</body>
<BODY>
<SCRIPT LANGUAGE= "JavaScript ">
<!--
function loadHeight()
{
document.all.t1.style.posHeight=document.all.t1.scrollHeight;
//alert(document.all.t1.scrollHeight);
//alert(document.all.t1.style.posHeight);
}
//-->
</SCRIPT>
</BODY>
</HTML>