jQuery Autosize plugin on dynamically added textarea elements

為{幸葍}努か 提交于 2019-12-06 06:45:14

sorry I can't comment yet, where are you adding this textarea at? can you post some of the code around the dynamic generation so that I can see when this stuff is getting called?

according to the docs, all you have to do is something like this for dynamically added elements...

function addTextArea() {
  $(body).append($('<textarea class="test" />'));
  $('.test').autosize();
});

//somewhere in code, but must be after the autosize plugin js has loaded
addTextArea();
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!