我正在开发一个使用 ckeditor 的 php 项目。其他一切似乎都工作正常,除了当我按回车键时我滚动到页面底部。我尝试了以下代码。
CKEDITOR.replace( fieldId,
{
height:heightVal,width:widthVal,
toolbar: [
{ name: 'document', items: [ 'Source' ] },
{ name: 'clipboard', items: [ 'Cut', 'Copy', 'Paste', 'PasteText', 'PasteFromWord', 'Undo', 'Redo'] },
{ name: 'editing', items: [ 'Find', 'Replace', '-', 'SelectAll' ] },
{ name: 'basicstyles', items: [ 'Bold', 'Italic', 'Strike', 'Subscript', 'Superscript', '-', 'RemoveFormat' ] },
{ name: 'tools', items: [ 'Maximize' ] },
{ name: 'paragraph', items: [ 'NumberedList', 'BulletedList', '-', 'Outdent', 'Indent', '-', 'JustifyLeft', 'JustifyCenter', 'JustifyRight', 'JustifyBlock' ] },
{ name: 'links', items: [ 'Link', 'Unlink'] },
{ name: 'insert', items: [ 'Image', 'Table', 'Flash', 'Video'] },
{ name: 'colors', items: [ 'TextColor' ] },
{ name: 'styles', items: [ 'Styles' ,'FontSize']},
{ name: 'about', items: [ 'About' ] }
],
enterMode : CKEDITOR.ENTER_DIV
}
);
这没有帮助。谁能告诉我如何解决这个问题。
最佳答案
我已经通过更改任何 CSS 规则 height: 100%
在我的项目中解决了此类问题至height: auto
用于编辑区域的父元素。就我而言,它是 <html>
,所以检查整个层次结构。
关于javascript - CKEditor 回车键滚动到页面底部,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30979630/