基于jQuery实现文本框缩放以及上下移动功能

2020-05-19 07:37:02易采站长站整理

想让你的网页更加的炫酷,想让你的留言评论更加的具有互动性吗,那么请仔细研究下本代码吧。

jQuery代码:


 $(function(){
          var $comment = $(‘#comment’);
          $(‘.bigger’).click(function(){
              if(!$comment.is(“:animated”)){
                  if($comment.height() < 500){
                      //$comment.height($comment.height() + 50);
                      $comment.animate({height:”+=50″},400);
                  }
              }
          });
           $(‘.smaller’).click(function(){
               if(!$comment.is(“:animated”)){
                   if($comment.height() > 50){
                       //$comment.height($comment.height() – 50);
                       $comment.animate({height:”-=50″},400);
                   }
               }
           });
           $(‘.up’).click(function(){
              if(!$comment.is(“:animated”)){
                  $comment.animate({scrollTop:”-=50″},400);
              }
           });
           $(‘.down’).click(function(){
               if(!$comment.is(“:animated”)){