JQuery text box scroll bar

From , 5 Years ago, written in JavaScript, viewed 123 times.
URL https://pastebin.vip/view/202cb962
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  2. <html xmlns="http://www.w3.org/1999/xhtml">
  3. <head>
  4. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  5. <title></title>
  6. <style type="text/css">
  7. * { margin:0; padding:0;font:normal 12px/17px Arial; }
  8. .msg {width:300px; margin:100px; }
  9. .msg_caption { width:100%; overflow:hidden; margin-bottom:1px;}
  10. .msg_caption span { display:block; float:left; margin:0 2px; padding:4px 10px; background:#898989; cursor:pointer;color:white; }
  11. .msg textarea{ width:300px; height:80px;height:100px;border:1px solid #000;}
  12. </style>
  13.  <!--   引入jQuery -->
  14.  <script src="../scripts/jquery-1.3.1.js" type="text/javascript"></script>
  15.  <script type="text/javascript">
  16.         $(function(){
  17.             var $comment = $('#comment');  //获取评论框
  18.             $('.bigger').click(function(){ //放大按钮绑定单击事件
  19.                           if( $comment.height() < 500 ){
  20.                                    $comment.height(  $comment.height() + 50 ); //重新设置高度,在原有的基础上加50
  21.                           }
  22.                 })
  23.                 $('.smaller').click(function(){//缩小按钮绑定单击事件
  24.                                 if( $comment.height() > 50 ){
  25.                                         $comment.height( $comment.height() - 50 ); //重新设置高度,在原有的基础上减50
  26.                                 }
  27.                 });
  28.         });
  29.   </script>
  30. </head>
  31. <body>
  32. <form action="" method="post">
  33. <div class="msg">
  34.         <div class="msg_caption">
  35.                 <span class="bigger" >放大</span>
  36.                 <span class="smaller" >缩小</span>
  37.         </div>
  38.         <div>
  39.                 <textarea id="comment" rows="8" cols="20">多行文本框高度变化.多行文本框高度变化.多行文本框高度变化.多行文本框高度变化.多行文本框高度变化.多行文本框高度变化.多行文本框高度变化.多行文本框高度变化.多行文本框高度变化.</textarea>
  40.         </div>
  41. </div>
  42. </form>
  43. </body>
  44. </html>

Reply to "JQuery text box scroll bar"

Here you can reply to the paste above

captcha

https://burned.cc - Burn After Reading Website