如何在更改字体大小后调整tinymce?

时间:2013-08-31 12:35:32

标签: resize tinymce-4

问题:当我更改了像38pt一样的字体大小时,文本就会退出编辑器。

我正在使用tinymce 4.0。

这是我加载tinymce的脚本

<script type="text/javascript">
tinymce.init({
        selector: "div#textareasDiv",
        theme: "modern",
        inline: true,
        plugins: [ "textcolor,table"],
        toolbar1: " bold italic underline | alignleft aligncenter alignright alignjustify | forecolor backcolor | fontselect |  fontsizeselect",
        image_advtab: true,
        menubar: false,
        fixed_toolbar_container: "#toolbarCon"


    });
</script>

<div id="textareasDiv"></div>
<div id="toolbarCon"></div>

<style>
#textareasDiv { padding:2px 5px;width:170px;height:80px;background:transparent;word-wrap: break-word; }
</style>

我正试图获得它的外部高度以便我可以对其进行更改:

setup : function(ed)
            {
                ed.on('change', function(e) 
                {
                    alert($(this.getContainer()).outerHeight());
                });
            }

但它什么都没给我。

如何在更改字体大小后调整tinymce编辑器的大小?怎么能让这个textareasDiv可以拖动?

HERE IS THE FIDDLE

1 个答案:

答案 0 :(得分:0)

您似乎在POST CSS定义中缺少 overflow

您可能希望将其设置为<textarea>,这是最常见的用法。 auto 的其他选项是:overflowscrolloverflow-xoverflow-y,具体取决于您尝试获得的结果实现。

此处有更多相关信息:https://www.w3schools.com/css/css_overflow.asp

相关问题