textarea自动增长宽高
2014-04-15 09:05
405 查看
<script type="text/javascript">
$(function(){
$("#iptcont").bind("keydown",function(e){
var key = e.which,that = this,h = 20;
if (key == 13) {
var brs = $(this).val().split("\n").length+1;
$(this).attr("rows",brs).height(h*brs);
}else if(key == 8){
window.setTimeout(function(){
var brs = $(that).val().split("\n").length;
$(that).attr("rows",brs).height(h*brs);
},100);
}
});
});
</script>
<body>
<textarea id="iptcont" rows="1" style="border:none;height:20px;border-bottom:1px solid blue;width:200px;resize:none;font-size:18px;line-height:20px;overflow:hidden;"></textarea>
</body>
$(function(){
$("#iptcont").bind("keydown",function(e){
var key = e.which,that = this,h = 20;
if (key == 13) {
var brs = $(this).val().split("\n").length+1;
$(this).attr("rows",brs).height(h*brs);
}else if(key == 8){
window.setTimeout(function(){
var brs = $(that).val().split("\n").length;
$(that).attr("rows",brs).height(h*brs);
},100);
}
});
});
</script>
<body>
<textarea id="iptcont" rows="1" style="border:none;height:20px;border-bottom:1px solid blue;width:200px;resize:none;font-size:18px;line-height:20px;overflow:hidden;"></textarea>
</body>
相关文章推荐
- sencha touch textarea 根据内容的自动增长与缩小
- jQuery实现textarea自动增长宽高的方法
- Extjs4 textarea文本框高度随内容自动增长
- textarea根据内容自动增长
- 【记录】用Javascript实现文本框textarea高度随内容自动适应增长收缩
- sencha touch 可自动增长高度TextArea
- jQuery实现textarea自动增长宽高的方法
- 数据库中主键自动增长
- sqlite3如何建立自动增长字段?
- textarea自动分行jquery php html简单做法
- Oracle 自动生成编号(实现sqlserver自增长字段)
- sqlserver2005jdbc解决自动自动增长列统一处理问题纪实
- SQL获取某表的索引或约束,并确定索引归属列,获取表中的自动增长列名。
- ORACLE中 SEQUENCE自动增长 用法
- 用PL/SQL编辑表格,使其字段自动增长。
- 兼容ie9的解决iframe的自动增长
- 关于SQL Server自动增长字段
- 手机页面text\textarea输入完成无法自动关闭
- Mysql,SqlServer,Oracle主键自动增长的设置
- oracle insert 自动增长 id