首页 > Web开发 > 详细

Html - TextArea - auto sizing to avoid scrollbar

时间:2015-12-04 14:53:26      阅读:320      评论:0      收藏:0      [点我收藏+]

A list of html TextArea element with class name "noteItem", below code will auto resize the TextArea to avoid scrollbar

JQuery:

$(‘.noteItem‘).each(function () {

var scrollHeight = $(this).prop(‘scrollHeight‘);

$(this).css(‘height‘,‘auto‘);

$(this).css(‘height‘, scrollHeight + ‘px‘);

});


reference - http://stackoverflow.com/questions/5980150/jquery-js-get-the-scrollbar-height-of-an-textarea

Html - TextArea - auto sizing to avoid scrollbar

原文:http://blog.csdn.net/jameszhou/article/details/50174357

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!