返回介绍

Autoresize plugin

发布于 2019-05-06 06:50:26 字数 2961 浏览 1077 评论 0 收藏 0

This plugin automatically resizes the editor to the content inside it. It is typically used to prevent the editor from expanding infinitely as a user types into the editable area. For example, by giving the autoresize_max_height option a value the editor will stop resizing when the set value is reached.

Type: String

Autoresize plugin example
tinymce.init({
  selector: "textarea",  // change this value according to your HTML
  plugins: "autoresize"
});

Options

These settings affect the execution of the Autoresize plugin, including changes to the minimum width, height, bottom margin, and default initialization state.

autoresize_bottom_margin

This option allows you to specify the size of the padding at the bottom of the editor’s body set on initialization.

Type: Number

Example
tinymce.init({
  selector: "textarea",  // change this value according to your HTML
  plugins: "autoresize",
  autoresize_bottom_margin: 50
});

max_height

This option enables you to specify the maximum height that the editor will automatically resize to when a user enters text into the editor. In other words, the editor will stop automatically resizing when the set value is reached.

Type: Number

Example
tinymce.init({
  selector: "textarea",  // change this value according to your HTML
  max_height: 500
});

min_height

This option enables you to specify the minimum height of the editor when it’s initialized.

Type: Number

Example
tinymce.init({
  selector: "textarea",  // change this value according to your HTML
  min_height: 350
});

autoresize_on_init

This option allows you to set whether the editor will attempt to resize itself upon initialization. By default this option is set to true.

Type: Boolean

Default Value: true

Possible Values: true, false

Example
tinymce.init({
  selector: "textarea",  // change this value according to your HTML
  plugins: "autoresize",
  autoresize_on_init: false
});

autoresize_overflow_padding

This option allows you to specify the size of the padding at the sides of the editor’s body set on initialization.

Type: Number

Example
tinymce.init({
  selector: "textarea",  // change this value according to your HTML
  plugins: "autoresize",
  autoresize_overflow_padding: 50
});

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文