小编Gra*_*rck的帖子

将焦点设置为在焦点CKEditor之后结束

可能重复:
CKEditor - 将光标位置设置为文本结尾

我有<div>很多内容.单击此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();
    }
  }
});
Run Code Online (Sandbox Code Playgroud)

javascript cursor caret selection ckeditor

6
推荐指数
1
解决办法
8114
查看次数

标签 统计

caret ×1

ckeditor ×1

cursor ×1

javascript ×1

selection ×1