第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號安全,請及時綁定郵箱和手機(jī)立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

創(chuàng)建具有自動調(diào)整大小的文本區(qū)域

創(chuàng)建具有自動調(diào)整大小的文本區(qū)域

斯蒂芬大帝 2019-06-09 15:57:25
創(chuàng)建具有自動調(diào)整大小的文本區(qū)域有關(guān)于這件事的另一條線索我試過了。但是有一個問題:textarea如果刪除內(nèi)容不會縮小。我找不到任何方法把它縮小到正確的尺寸clientHeight值的完整大小返回。textarea而不是它的內(nèi)容。該頁的代碼如下:function FitToContent(id, maxHeight){    var text = id && id.style ? id : document.getElementById(id);    if ( !text )       return;    var adjustedHeight = text.clientHeight;    if ( !maxHeight || maxHeight > adjustedHeight )    {       adjustedHeight = Math.max(text.scrollHeight, adjustedHeight);       if ( maxHeight )          adjustedHeight = Math.min(maxHeight, adjustedHeight);       if ( adjustedHeight > text.clientHeight )          text.style.height = adjustedHeight + "px";    }}window.onload = function() {     document.getElementById("ta").onkeyup = function() {       FitToContent( this, 500 )     };}
查看完整描述

3 回答

  • 3 回答
  • 0 關(guān)注
  • 522 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動學(xué)習(xí)伙伴

公眾號

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號