作家
登录

基于jquery的让textarea自适应高度的插件

作者: 来源:www.28hudong.com 2013-03-30 01:24:30 阅读 我要评论

Introduction 1. This textarea is like the google calendar's description when you create one new or update one existence calendar; 2. Its height will be changed accroding to user's input; 3. Its scrollbar is removed, which makes it much user friendly. I guess you may like it. Using the code 1. import the jquery.js and textarea.js <script language="javascript" type="text/javascript" src="js/jquery.min.js"></script> <script language="javascript" type="text/javascript" src="js/textarea.js"></script> 2. add the following css <style type="text/css"> .autoHeight{border:1px solid #666666; width:300px; height:60px; line-height:20px; font:11px verdana; overflow:hidden;} </style> 3. add one textare html control <textarea class="autoHeight" id="textarea1"></textarea> 4. make it works <script language="javascript" type="text/javascript"> $(document).ready(function () { $(".autoHeight").TextAreaAutoHeight(); }); </script>

  推荐阅读

  style、 currentStyle、 runtimeStyle区别分析

1、obj.style只能获得内嵌样式(inline Style)就是写在Tag里面的,他访问不到那些链接的外部css和在head中用<style>声明的style。 所以必须认识到在那些使用外部Css文件的页面中,如果用style赋值,如obj.style=“>>>详细阅读


本文标题:基于jquery的让textarea自适应高度的插件

地址:http://www.17bianji.com/kaifa2/JS/25929.html

关键词: 探索发现

乐购科技部分新闻及文章转载自互联网,供读者交流和学习,若有涉及作者版权等问题请及时与我们联系,以便更正、删除或按规定办理。感谢所有提供资讯的网站,欢迎各类媒体与乐购科技进行文章共享合作。

网友点评
自媒体专栏

评论

热度

精彩导读
栏目ID=71的表不存在(操作类型=0)