Html - TextArea - auto sizing to avoid scrollbar

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

时间: 2024-08-27 11:14:42

Html - TextArea - auto sizing to avoid scrollbar的相关文章

[React] Create a Virtualized List with Auto Sizing Cells using react-virtualized and CellMeasurer

In this lesson we'll use CellMeasurer and CellMeasurerCache to automatically calculate and cache the height of a row. This will allow us to remove the predefined rowHeight on list and allow for dynamically sized rows. import React, {Component} from '

SublimeText3 生成html标签快捷键

Sublime Text生成html标签快捷键 mmet Documentation Syntax Child: > nav>ul>li <nav> <ul> <li></li> </ul> </nav> Sibling: + div+p+bq <div></div> <p></p> <blockquote></blockquote> Climb

Zen Coding使用及常用简写

使用方法:写好简写,按下tab键,自动补全,比如写下html再按tab键,将会出现"<html></html>" html <html></html> html:xml <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="ru"></html> html:4t <!DOCTYPE HTML PUBLIC "

emmet(Zen coding)帮助文档

葵花宝典终可成,半途而废万事空. 官方地址:http://docs.emmet.io/cheat-sheet/ 我导出了pdf版,需要的同学可以下载: 链接:http://pan.baidu.com/s/1eQ74eSM 密码:laz1 Syntax Child: > nav>ul>li <nav> <ul> <li></li> </ul> </nav> Sibling: + div+p+bq <div>

emmet语法列表

emmet语法 Child: > nav>ul>li <nav> <ul> <li></li> </ul> </nav> Sibling: + div+p+bq <div></div> <p></p> <blockquote></blockquote> Climb-up: ^ div+div>p>span+em^bq <div&

关于sublime text3 快捷键和主题以及插件快捷键设置

//用解压器"打开"把Monokai.tmTheme文件解压到桌面然后用sublime打开新增下面的代码,然后保存把文件拖回去关闭解压器即可 //Monokai.tmTheme文件增加下面的代码使非标签内容显示不同颜色 // <dict> // <key>name</key> // <string>Tag name other</string> // <key>scope</key> // <st

Zen Coding)官方文档 一览表

语法 Child: > nav>ul>li <nav> <ul> <li></li> </ul> </nav> Sibling: + div+p+bq <div></div> <p></p> <blockquote></blockquote> Climb-up: ^ div+div>p>span+em^bq <div>&l

Saiku更改導出文件的文件名(十九)

Saiku更改導出文件的文件名 Saiku查询完数据之后,可以以excel,pdf,csv等格式将数据导出,这里我们来讲一下怎么更改导出的文件名. 找到对应的导出方法所在的js文件: saiku-server\tomcat\webapps\ROOT\js\saiku\views\WorkspaceToolbar.js 这里分别有三个方法导出不同形式的文件: export_xls export_csv export_pdf 我们主要更改里面的filename即可啦! 可以自定义filename,我

我的项目8 css属性,实现阅读器重排版功能

对于小说阅读器,相信兄弟们都很熟悉,那么它是如何实现的呢?早这里分享一些经验之谈. 首先,在我的思路中,在制定多页,和重排版功能的实现,可能需要用到CSS3的一个属性:column-count:3(多列)思路是这样的,也不知道对不对,用HTML5+CSS3写一个可阅读的文本,然后用column-count属性进行分列,在移动端里,那么一本书就相当于一个页面,而每一页则相当于一列,而通过改变column-count的值则实现了重排版功能.不多说分享示例代码. <!DOCTYPE html PUBL