// 自动伸缩,自动提交
$('textarea').keyup(function(e) {
if((e.ctrlKey && (e.which == 13 || e.which == 10)) || (e.altKey && e.which == 83)) {
//Ctrl+Enter执行
return false;
}
if(e.which == 13){ //输入回车键
var h = $(this)[0].scrollHeight;
if(h <= 100) {
return true;
} else {
$(this).height($(this)[0].scrollHeight);
return true;
}
}
});
JQuery自动调整textarea内容高度
0 Previous ArticleJS判断是否存在指定函数
Next Article 宝塔面板回收站所在路径