KindEditor文字自适应高度

  <script>
            var editor;
            KindEditor.ready(function(K) {
                editor = K.create('textarea[name="content"]', {
                    resizeType : 1,
                    allowPreviewEmoticons : false,
                    allowImageUpload : false,
                    items : ['emoticons', 'image', 'link'],
                    afterChange : function () {  //输入文字事件
                        var autoheight = K.IE ? this.edit.doc.body.scrollHeight : this.edit.doc.body.offsetHeight;  //判断是否是IE,并获取内容高度。
                         this.edit.setHeight(autoheight);   //设置高度
                    }
                });
            });
  </script>

原文地址:https://www.cnblogs.com/baie/p/2588770.html