復制代碼 代碼如下:
$(function(){ 
    var $comment = $('#comment');  //獲取評論框  
    $('.bigger').click(function(){ //放大按鈕綁定單擊事件  
       if(!$comment.is(":animated")){ //判斷是否處于動畫  
          if( $comment.height() < 500 ){  
                $comment.animate({ height : "+=50" },400); //重新設置高度,在原有的基礎上加50  
          } 
        } 
    }) 
    $('.smaller').click(function(){//縮小按鈕綁定單擊事件  
       if(!$comment.is(":animated")){//判斷是否處于動畫  
            if( $comment.height() > 50 ){ 
                $comment.animate({ height : "-=50" },400); //重新設置高度,在原有的基礎上減50  
            } 
        } 
    }); 
}); 
新聞熱點
疑難解答
圖片精選