我在我的项目中使用CKEditor,我要求在页面上打印ckeditor内容,所以我想限制ckeditor的高度,所以我给出了220px的高度并使用overflow:hidden删除了滚动条,但是当用户结束时在ckeditor区域和按下输入,内容增加而没有滚动条选项。
有什么方法可以限制ckeditor中的内容行数?
以下是我的ckeditor代码:
CKEDITOR.replace('summaryEditor',
{
toolbar:
[
{ name: 'customToolBar', items: ['Bold', 'Italic', 'Underline', 'JustifyLeft', 'JustifyCenter', 'Font', 'FontSize', 'NumberedList', 'BulletedList', 'Link', 'Image', 'Table', 'Source', 'questions'] }
],
height: '220px',
resize_enabled: false,
contentsCss: 'body {overflow:hidden;}',
autoGrow_onStartup: false,
extraPlugins: 'questions',
removePlugins: 'elementspath'
});
答案 0 :(得分:0)
自动增长插件不是CKEditor的3个默认构建版本的一部分,基本,标准或完整。所以我不确定你是如何安装和启用的,如果你不想要它。
但是,如果你只是在你的removePlugins列表中添加'autogrow',它应该停止。
但是,你的身高设置应该覆盖编辑器内容的高度。我只是将高度设置为100并且工作正常。
CKEDITOR.replace('editor', {
height: 100
});
这是一个展示的plnkr: http://plnkr.co/edit/lsFaT1CMMeDePnjVc5RD?p=preview