textarea自动弹出高度vartextArer=document.querySelectorAll('.textarea');对于(vari=0;iminHeight){if(maxHeight&&elem.scrollHeight>maxHeight){height=maxHeight-padding;style.overflowY='自动';}else{height=elem.scrollHeight-填充;style.overflowY='隐藏';}style.height=height+extra+'px';scrollTop+=parseInt(style.height)-elem.currHeight;document.body.scrollTop=scrollTop;document.documentElement.scrollTop=scrollTop;elem.currHeight=parseInt(style.height);}};addEvent('propertychange',改变);addEvent('输入',改变);addEvent('焦点',改变);改变();}