如何将tinymce
编辑器高度设置为36px,当我设置此iframe高度变为67px时。如果我将高度设置在100以上就可以了。我需要编辑器通过键入或粘贴来自动调整大小
我的代码是这样的:
tinymce.init({
selector: "textarea,
plugins: ["paste autoresize"],
height : '40px',
icon: false, menubar: false, statusbar: false, toolbar: false, autoresize_bottom_margin: 10, object_resizing: false,
paste_as_text: true, force_br_newlines: true,autoresize_max_height : "300px",
});
答案 0 :(得分:2)
我通过设置像
这样的init选项来实现它 tinymce.init({
selector: "textarea,
plugins: ["paste autoresize"],
autoresize_bottom_margin: 2,
autoresize_min_height: 36,
autoresize_max_height: 300,
icon: false, menubar: false, statusbar: false, toolbar: false, autoresize_bottom_margin: 10, object_resizing: false,
paste_as_text: true, force_br_newlines: true,
});
答案 1 :(得分:1)
您可以使用min_height
配置设置
在您的情况下,代码应为:
tinymce.init({
selector: "textarea",
plugins: ["paste autoresize"],
min_height: 10,
height : 30,
icon: false,
menubar: false,
statusbar: false,
toolbar: false,
autoresize_bottom_margin: 10,
object_resizing: false,
paste_as_text: true,
force_br_newlines: true,
autoresize_max_height : "300px"
});
如你所说,使用autoresize
插件无效。也许这是autoresize
插件的问题。无论如何,我测试了另一个选项autoresize_min_height : 30
,但似乎这也不起作用。