这是我的标签要获取的内容、
<logic:iterate id="obj" name="businessList" indexId="index"><tr>
.
.
.
<td> <html:textarea name="obj" property="bidScope" styleId = "ywAreaid" cols="5" rows="1" style="overflow:hidden;width:100%;border:0;" readonly="true" onfocus="openare()" onblur="closeare()"></html:textarea> </td> <td>
....
</td>
.
.
.
</tr></logic:iterate>
我读取数据的时候,默认是显示 1行 5个字的 。其实有好多个字、!我要的效果是当我鼠标点击 文本域的时候,显示所有内容。
当失去焦点的时候,就恢复。------------------------------------------------------------------
<html:textarea name="obj" property="bidScope" cols="5" rows="1" style="overflow:hidden;width:100%;border:0;" readonly="true" onfocus="window.activeobj=this;this.clock=setInterval(function(){activeobj.style.height=activeobj.scrollHeight+'px';},200);" onblur="window.activeobj=this;this.clock=setInterval(function(){activeobj.style.height=80+'px';},200);"></html:textarea>
上面这个可以变大适应内容大小、 可是 不能恢复!
-------------------------------------------------------js不好菜弄不出啊、 高手帮帮忙!顺便问几个问题、 为什么我用getelementbyId("ywAreaid").value; 得不到我读出来的值 ;
<logic:iterate id="obj" name="businessList" indexId="index"><tr>
.
.
.
<td> <html:textarea name="obj" property="bidScope" styleId = "ywAreaid" cols="5" rows="1" style="overflow:hidden;width:100%;border:0;" readonly="true" onfocus="openare()" onblur="closeare()"></html:textarea> </td> <td>
....
</td>
.
.
.
</tr></logic:iterate>
我读取数据的时候,默认是显示 1行 5个字的 。其实有好多个字、!我要的效果是当我鼠标点击 文本域的时候,显示所有内容。
当失去焦点的时候,就恢复。------------------------------------------------------------------
<html:textarea name="obj" property="bidScope" cols="5" rows="1" style="overflow:hidden;width:100%;border:0;" readonly="true" onfocus="window.activeobj=this;this.clock=setInterval(function(){activeobj.style.height=activeobj.scrollHeight+'px';},200);" onblur="window.activeobj=this;this.clock=setInterval(function(){activeobj.style.height=80+'px';},200);"></html:textarea>
上面这个可以变大适应内容大小、 可是 不能恢复!
-------------------------------------------------------js不好菜弄不出啊、 高手帮帮忙!顺便问几个问题、 为什么我用getelementbyId("ywAreaid").value; 得不到我读出来的值 ;
我已经解决了。。 摸索了差不多一天了、呵呵! 慢慢试出来的、 . 主要的是传值问题
-------------------<html:textarea name="obj" property="bidScope" cols="5" rows="1" style="overflow:hidden;width:100%;border:0;" readonly="true"onfocus="openare(window.activeobj=this)"
onblur="closeare(window.activeobj=this)"
></html:textarea>
这样也可以,太帅了!-------------------------function openare(obj) //获取滚动高度 作为高度!
{
obj.style.height=obj.scrollHeight;
} function closeare(obj){ //这里恢复我给了17px;
obj.style.height=17;
}