jquery 改變textarea高度
var $comment = $('#comment'); //獲取評論框 $('.bigger').click(function(){ //放大按鈕綁定單擊事件 if( $comment.height() < 500 ){ $comment.height( $comment.height() + 50 ); //重新設置高度,在原有的基礎上加50 } }) $('.smaller').click(function(){//縮小按鈕綁定單擊事件 if( $comment.height() > 50 ){ $comment.height( $comment.height() - 50 ); //重新設置高度,在原有的基礎上減50 } });
本文由用戶 n3xb 自行上傳分享,僅供網友學習交流。所有權歸原作者,若您的權利被侵害,請聯系管理員。
轉載本站原創文章,請注明出處,并保留原始鏈接、圖片水印。
本站是一個以用戶分享為主的開源技術平臺,歡迎各類分享!