【发布时间】:2012-01-19 00:57:09
【问题描述】:
我在使用 CKEditor 自动增长插件时遇到问题:
按下回车后(在自动增长到最小高度之后),文本内容会抖动(向上跳一行并向下跳),并且垂直滚动条会时断时续地闪烁。自动增长有效,但用户体验生涩。
我可以通过指定scrolling="no"和overflow="hidden"来隐藏垂直滚动条,但是文字内容还是会抖动。
我在 ckeditor.js 中禁用滚动:
<iframe scrolling="no" style="width:100%;height:100%;overflow:hidden;" frameBorder="0" title="'+E+'"'+' src="'+W+'"'+' tabIndex="'+(b.webkit?-1:C.tabIndex)+'"'+' allowTransparency="true"'+'></iframe>
CKEditor初始化代码:
CKEDITOR.replace('Description',
{
sharedSpaces:
{
top: 'topSpace',
bottom: 'bottomSpace'
},
extraPlugins: 'autogrow,tableresize',
removePlugins: 'maximize,resize,elementspath',
skin: 'kama',
toolbar: [['Format', 'Font', 'FontSize'], ['Bold', 'Italic', 'Underline', 'Strike', 'Subscript', 'Superscript', '-', 'RemoveFormat'], ['TextColor', 'BGColor'], ['JustifyLeft', 'JustifyCenter', 'JustifyRight', 'JustifyBlock'], ['NumberedList', 'BulletedList'], ['Outdent', 'Indent'],
'/', ['Link', 'Unlink', 'Anchor'], ['Image', 'Flash', 'Table', 'HorizontalRule', 'SpecialChar'], ['PasteText', 'PasteFromWord'],['Cut','Copy','Paste'], ['Undo', 'Redo'], ['Find', 'Replace'], ['SpellChecker']],
toolbarCanCollapse: false,
pasteFromWordRemoveFontStyles: false,
enterMode: CKEDITOR.ENTER_BR,
shiftEnterMode: CKEDITOR.ENTER_P,
autoGrow_minHeight: 300
})
有什么方法可以避免在按下回车键时文本内容跳跃/移动(在自动增长超过最小高度之后)?
【问题讨论】:
标签: javascript ckeditor fckeditor autogrow