联系我们
简单又实用的WordPress网站制作教学
当前位置:网站首页 > 网页前端技术 > 正文

基于jquery的让textarea自适应高度的插件 - Web前端

作者:98wpeu发布时间:2026-07-21分类:网页前端技术浏览:7


导读:introduction1.thisTextareaislikethegooglecalendar'sdescriptionwhenyoucreateone...
introduction
1. thisTextarea 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>

标签:自适应插件高度Webtextareajquery


网页前端技术排行
最近发表
网站分类
标签列表