【问题标题】:How to set initial height for CKEditor + div editing areaCKEditor+div编辑区如何设置初始高度
【发布时间】:2015-10-25 17:56:45
【问题描述】:

我正在使用带有 div 编辑区域插件的 CKEditor 4。默认情况下,当使用 iframe 模式 时,高度设置为设置的行数,并且会随着文本的增长而调整大小。现在因为我使用的是 div 区域插件,所以默认高度不受设置的值的影响,而是取决于里面的文本。如何解决这个问题??

如果我在此处手动更改高度,则 textarea 将不会扩展。

<div id="cke_1_contents" class="cke_contents cke_reset" role="presentation" style="height: auto;">
    <div class="cke_wysiwyg_div cke_reset cke_editable cke_editable_themed cke_contents_ltr cke_show_borders" hidefocus="true" contenteditable="true" tabindex="0" spellcheck="false" style="position: relative;" role="textbox" aria-label="Rich Text Editor, editor1" title="Rich Text Editor, editor1" aria-describedby="cke_128">
    <p>This is my textarea to be replaced with CKEditor.</p>
    </div>

    <span id="cke_128" class="cke_voice_label">Press ALT 0 for help</span>
</div>

【问题讨论】:

    标签: javascript ckeditor


    【解决方案1】:

    在 ckeditor/config.js 中更改它

    CKEDITOR.editorConfig = function( config )
    {
        config.height = '800px';
    };
    

    如果这不起作用,你可以试试这个: http://www.stepcoder.com/Articles/10003/how-to-set-or-change-height-of-ckediotr-textbox-area-using-asp-net

    【讨论】:

    • 不起作用。你提供的链接和你刚才说的一样。
    猜你喜欢
    • 2018-03-15
    • 1970-01-01
    • 2011-08-05
    • 2013-11-15
    • 1970-01-01
    • 2021-08-10
    • 1970-01-01
    • 2023-01-27
    • 1970-01-01
    相关资源
    最近更新 更多