如何将tinymce
编辑器高度设置为36 to,当设置此高度时,iframe高度变为67 to。如果我把高度设定在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",
});
发布于 2016-05-26 09:43:03
我通过设置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, });
发布于 2015-09-09 08:41:52
可以使用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
,但是看起来这也不起作用。
https://stackoverflow.com/questions/32474632
复制相似问题