将插入符号设置为焦点后结束 CKEditor
可能的重复:
CKEditor - 将光标位置设置为文本末尾
我有一个
有很多内容。单击此 div 后,将加载 CKEditor 来编辑此 div。现在我想在用编辑器替换它后将插入符号/光标设置到内容的末尾。
我的代码目前是这样的:
var editor = CKEDITOR.replace('content', {
// Settings
// Event listeners
on: {
instanceReady: function(evt) {
var editor = evt.editor;
// give focus (displays caret at the beginning of the content, not the end)
editor.focus();
}
}
});
Possible Duplicate:
CKEditor - Set cursor position to end of text
I have a <div>
with a lot of content. After a click on this div, the CKEditor is loaded to edit this div.
Now I would like to set the caret/cursor to the end of the contents after replacing it with the editor.
My code currently is something like this:
var editor = CKEDITOR.replace('content', {
// Settings
// Event listeners
on: {
instanceReady: function(evt) {
var editor = evt.editor;
// give focus (displays caret at the beginning of the content, not the end)
editor.focus();
}
}
});
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
经过一番摆弄后,我已经让它可以使用以下代码:
这个想法是:
After a bit of fiddling, I've got it to work with the following code:
The idea is: