最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

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

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

想讓你的網(wǎng)頁更加的炫酷,想讓你的留言評論更加的具有互動性嗎,那么請仔細研究下本代碼吧。

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ā)放松放松沙發(fā)
                當爽膚水飛沙發(fā)發(fā)沙發(fā)發(fā)發(fā)發(fā)
                水電費水電費爽膚水法薩芬沙發(fā)放松放松沙發(fā)
                當爽膚水飛沙發(fā)發(fā)沙發(fā)發(fā)發(fā)發(fā)
            </textarea>
        </div>
    </div>

CSS代碼:

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

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

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

相關(guān)文章

最新評論

庐江县| 郴州市| 广平县| 乐安县| 榆树市| 阜康市| 淮滨县| 嘉禾县| 乡宁县| 师宗县| 宿州市| 仁布县| 义乌市| 新乡市| 临夏市| 罗定市| 西盟| 嘉善县| 凤翔县| 延川县| 油尖旺区| 玉山县| 舒城县| 奉化市| 凉城县| 西安市| 金沙县| 南通市| 隆尧县| 巫溪县| 苏州市| 炉霍县| 洱源县| 托克托县| 神木县| 肥西县| 上蔡县| 大同市| 泸水县| 乌拉特后旗| 清水河县|