亚洲乱码中文字幕综合,中国熟女仑乱hd,亚洲精品乱拍国产一区二区三区,一本大道卡一卡二卡三乱码全集资源,又粗又黄又硬又爽的免费视频

基于jQuery實(shí)現(xiàn)文本框縮放以及上下移動(dòng)功能

 更新時(shí)間:2014年11月24日 14:56:53   投稿:hebedich  
這里給大家分享一段個(gè)人覺(jué)著非常實(shí)用也經(jīng)常用于項(xiàng)目中的代碼,本代碼基于jQuery實(shí)現(xiàn)了文本框縮放以及上下移動(dòng)功能,給需要的網(wǎng)友們參考下吧

想讓你的網(wǎng)頁(yè)更加的炫酷,想讓你的留言評(píng)論更加的具有互動(dòng)性嗎,那么請(qǐng)仔細(xì)研究下本代碼吧。

jQuery代碼:

復(fù)制代碼 代碼如下:

 $(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")){
                   $comment.animate({scrollTop:"+=50"},400);
               }
           });
       }); 

HTML代碼:

復(fù)制代碼 代碼如下:

<div class="msg">
       <div class="msg_caption">
           <span class="bigger">放大</span>
           <span class="smaller">縮小</span>
           <span class="up">向上</span>
           <span class="down">向下</span>
       </div>
        <div>
            <textarea id="comment" rows="8" cols="20">
                 水電費(fèi)水電費(fèi)爽膚水法薩芬沙發(fā)放松放松沙發(fā)
                當(dāng)爽膚水飛沙發(fā)發(fā)沙發(fā)發(fā)發(fā)發(fā)
                水電費(fèi)水電費(fèi)爽膚水法薩芬沙發(fā)放松放松沙發(fā)
                當(dāng)爽膚水飛沙發(fā)發(fā)沙發(fā)發(fā)發(fā)發(fā)
            </textarea>
        </div>
    </div>

CSS代碼:

復(fù)制代碼 代碼如下:

.bigger , .down , .up , .smaller{
    background-color: #f1a55c;

代碼奉上,具體如何使用,使用在何處,我就不多說(shuō)了,小伙伴們自由發(fā)揮吧。

相關(guān)文章

最新評(píng)論