textarea的滚动条是否开启
2016-04-04 14:48
211 查看
要设置textarea文本域的滚动条是否开启,使用style.overflow-x属性来控制。如:如果要隐藏该文本域的横向滚动条,在style属性中增加overflow-x属性控制,如下:
<textarea id=txtComments style="overflow-x:hidden"></textarea>
相应的,若要隐藏纵向滚动条:
<textarea id=txtComments style="overflow-y:hidden"></textarea>
如果使用代码控制的话,可能需要如下代码实现:
document.all("txtComments").style.overflowX="hidden";
overflow-x,overflow-y的可取值为:visible(默认取值),hidden,auto,scroll。具体解释参加如下文档(摘自MSDN帮助文档):
visible (Default)- Content is not clipped and scroll bars are not added. Elements are clipped to the size of the containing window or frame.
scroll -Content is clipped and scroll bars are added, even if the content does not exceed the dimensions of the object.
hidden Content that exceeds the dimensions of the object is not shown.
auto Content is clipped and scrolling is added only when necessary.
原文链接:http://blog.sina.com.cn/s/blog_4d54fab10100la4q.html
<textarea id=txtComments style="overflow-x:hidden"></textarea>
相应的,若要隐藏纵向滚动条:
<textarea id=txtComments style="overflow-y:hidden"></textarea>
如果使用代码控制的话,可能需要如下代码实现:
document.all("txtComments").style.overflowX="hidden";
overflow-x,overflow-y的可取值为:visible(默认取值),hidden,auto,scroll。具体解释参加如下文档(摘自MSDN帮助文档):
visible (Default)- Content is not clipped and scroll bars are not added. Elements are clipped to the size of the containing window or frame.
scroll -Content is clipped and scroll bars are added, even if the content does not exceed the dimensions of the object.
hidden Content that exceeds the dimensions of the object is not shown.
auto Content is clipped and scrolling is added only when necessary.
原文链接:http://blog.sina.com.cn/s/blog_4d54fab10100la4q.html
相关文章推荐
- 实习生面试相关-b
- 程序员面试什么最重要
- Ajax实例
- 使用Def文件导出dll
- stateflow使用
- lintcode-medium-Pow(x, n)
- Tsinsen A1121 回文数
- POJ-3177-Redundant Paths【双连通分支】
- NYOJ 1036 非洲小孩(水题)
- 学生破解极域电子教室的破解器
- WebView属性示例
- 向Lucene增加中文分词功能
- mysql小笔记
- 【工具】UML工具
- IOS响应式编程框架ReactiveCocoa(RAC)使用示例-备
- 《leetCode》:Number of Islands
- [转载]C++中类的组合
- Manage Code 托管代码
- matlab simulink 使用总结
- spring security+mybatis+springMVC构建一个简单的项目