【问题标题】:How to add scroll bar to context menu ckeditor如何将滚动条添加到上下文菜单ckeditor
【发布时间】:2016-03-02 12:07:08
【问题描述】:

我正在上下文菜单中添加项目。 当添加太多项目时,它会出现在 ckeditor 上。 所以我想有上下文菜单的滚动条。

editor.addMenuItem(suggestionBoxItem,
                                        {
                                            id: Id,
                                            label: menuLabel,
                                            group: 'suggestionBoxGroup',
                                            icon: null,
                                            onClick: function () {
                                                editor.setData('');
                                                editor.insertHtml(this.labelText);
                                            },
                                        });

【问题讨论】:

  • 你找到解决这个问题的方法了吗?
  • 我通过覆盖 ckeditor css 做到了。

标签: javascript jquery css ckeditor4.x ckeditor.net


【解决方案1】:

您必须自定义 ckeditor CSS。在您的 ckeditor/skins/SKIN_NAME 文件夹中,您必须在相应的 *.css 文件中找到以下属性(在我的情况下,它是 editor.css 并覆盖它们。

.cke_panel {
    height: YOUR_DEFAULT_HEIGHT;
    max-height: MAX_HEIGHT;
}

.cke_menu_panel {
    overflow-y: auto;
}

当上下文菜单正在加载且不存在溢出时,height 是您的默认高度。最大高度是启用上下文菜单中的滚动时。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2023-03-14
    • 1970-01-01
    • 2010-09-27
    • 1970-01-01
    • 1970-01-01
    • 2013-03-26
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多