CKEditor is the outstanding WYSIWYG editor we use on the Mozilla Developer Network. We have many custom plugins and we do everything we can to make writing easy for contributors. One trick I just picked up was skipping to an element within the editor by ID and setting the cursor focus within that element. Here's how!
CKEditor是我们在Mozilla开发人员网络上使用的出色的WYSIWYG编辑器。 我们有许多自定义插件,我们将尽一切努力使贡献者的写作变得容易。 我刚掌握的一个技巧是通过ID跳到编辑器中的某个元素,然后在该元素中设置光标焦点。 这是如何做!
JavaScript (The JavaScript)
You'll start by scrolling the element into view within CKEditor:
首先,将元素滚动到CKEditor中的视图中:
var element = editor.document.getById('someHeading');
var range;
if(element) {
element.scrollIntoView();
// Thank you S/O
// http://stackoverflow.com/questions/1683536