首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >TinyMce -如何在使用自动调整大小插头时将编辑器高度设置在50 to以下

TinyMce -如何在使用自动调整大小插头时将编辑器高度设置在50 to以下
EN

Stack Overflow用户
提问于 2015-09-09 08:30:09
回答 2查看 556关注 0票数 1

如何将tinymce编辑器高度设置为36 to,当设置此高度时,iframe高度变为67 to。如果我把高度设定在100以上,那就很好了。我需要编辑器通过输入或粘贴来自动调整大小。

我的代码是这样的:

代码语言:javascript
运行
复制
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", 
});
EN

回答 2

Stack Overflow用户

回答已采纳

发布于 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, });

票数 2
EN

Stack Overflow用户

发布于 2015-09-09 08:41:52

可以使用min_height配置设置。

在您的例子中,代码应该是:

代码语言:javascript
运行
复制
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,但是看起来这也不起作用。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/32474632

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档