CKEditor即时编辑配置

问题描述 投票:1回答:2

我有config.js文件,但我也想动态配置一些按钮。这是我的页面代码:

 CKEDITOR.on('instanceReady', function (evt)
                  {

                    CKEDITOR.instances.MY_INSTANCE.destroy();
                    CKEDITOR.config.toolbar_Basic = [['Bold']];
                    CKEDITOR.config.toolbar = 'Basic';
                    CKEDITOR.config.width=400;
                    CKEDITOR.config.height=300;
                    CKEDITOR.replace('MY_INSTANCE', CKEDITOR.config);
});

当我进入页面时,textarea闪烁并且一直显示/消失。怎么了?如何动态更改ckeditor的配置?

PS。我见过this answer,但它对我帮助不大

javascript jquery ckeditor
2个回答
1
投票

用这个:-

 CKEDITOR.replace( 'editor1', {
        language: 'fr',
        uiColor: '#9AB8F3'
    });

For More information click here


1
投票

如果有人想知道多个编辑器解决方案,我发现这是最好的。

$(".ckeditor").each(function() {
    CKEDITOR.replace($(this).attr("id"), {
        extraPlugins: 'justify,font'
    });
});
© www.soinside.com 2019 - 2024. All rights reserved.