输入框高度控制

This commit is contained in:
txz 2016-07-19 15:41:40 +08:00
parent 2af1a5ffb9
commit 5b3c6cc012
2 changed files with 4 additions and 4 deletions

View File

@ -8,11 +8,11 @@ app.directive('inputAuto',function(){
element.on('input',function(){
console.log(sendButton);
copyContainer.html(element[0].value);
var textHeight = copyContainer[0].scrollHeight;
var textHeight = copyContainer[0].scrollHeight-10;
element.css('height', textHeight + 'px');
});
sendButton.on('click',function(){
element.css('height','28px');
element.css('height','18px');
});
}
}

View File

@ -129,8 +129,8 @@ a.underline {text-decoration:underline;}
.post-reply-date, .post-reply-trigger {font-size:13px;}
.post-input-container {position:relative; padding-right:70px;}
.copy-input-container {position:relative; padding-right:70px;}
.copy-input {width:100%; height:28px; line-height:28px; padding:0 5px; vertical-align: middle; font-size:12px; border-radius:3px; position:absolute; left:-999em;}
.post-reply-input {width:100%; height:28px; max-height:84px; line-height:28px; vertical-align: middle; font-size:13px; border:1px solid #e6e6e6; outline:none; padding:0 5px; margin:0; border-radius:3px; overflow-y:auto; resize:none; background-color:#f0eff4;}
.copy-input {width:100%; height:18px; line-height:18px; padding:5px; vertical-align: middle; font-size:12px; border-radius:3px; position:absolute; left:-999em;}
.post-reply-input {width:100%; height:18px; max-height:54px; line-height:18px; vertical-align: middle; font-size:13px; border:1px solid #e6e6e6; outline:none; padding:5px; margin:0; border-radius:3px; overflow-y:auto; resize:none; background-color:#f0eff4;}
.post-reply-submit {position:absolute; font-size:13px; height:30px; line-height:30px; vertical-align:middle; padding:0 8px; color:#fff; background-color:#269ac9; outline:none; border:none; top:0; right:0;}
.reply-icon {background:url(/images/wechat/icon_list.gif) -150px -155px no-repeat; width:20px; height:20px; display:inline-block; vertical-align:middle;}
.praise-icon {background:url(/images/wechat/icon_list.gif) -36px -88px no-repeat; width:20px; height:20px; display:inline-block; vertical-align:middle;}