web前端|js教程
jquery,textarea,高度自适应
web前端-js教程
之前给大家分享过用Javascript控制文本框textarea高度随内容自适应增长收缩,今天花了点时间换了种实现方法,总结一下
安卓京东商城免费源码,ubuntu修改启动账户,网络爬虫书籍下载,PHP名牌扫描,seo 意思 广东lzw
jQuery.fn.extend({
autoHeight: function(){
return this.each(function(){
var $this = jQuery(this);
if( !$this.attr(\_initAdjustHeight) ){
$this.attr(\_initAdjustHeight, $this.outerHeight());
}
_adjustH(this).on(input, function(){
_adjustH(this);
});
});
/**
* 重置高度
* @param {Object} elem
*/
function _adjustH(elem){
var $obj = jQuery(elem);
return $obj.css({height: $obj.attr(\_initAdjustHeight), overflow-y: hidden})
.height( elem.scrollHeight );
}
}
});
// 使用
$(function(){
$( extarea).autoHeight();
});
unity3d跑酷游戏源码,上班族用VScode,ubuntu配置ssd,通网页登录tomcat,爬虫网页请求,php 网站自动登录,坪山seo整站优化公司,手机网站商品展示代码,dz简洁手机模板lzw
以上就是本文所述的全部内容了,希望对大家学习jQuery能够有所帮助。
qq视频偷看源码,vscode代码空格,ubuntu臃肿,tomcat怎样停止,sqlite2 版本差异,万能表单报名系统插件,app的前端用什么框架写,js逆向爬虫需要学习哪些,php开关,伦敦seo优化排名,团购网站源码 .net,名片网页源码,h5建站响应式模板下载lzw