0

CKEditor中:根据我的要求,我只想通过其 Id 选择元素并滚动到该位置。

我已经编写了在 FF 中运行良好的代码,但我没有得到 IE 的解决方案。

下面是 FF 的代码:

Ele = EditorInstance.document.getById(Id);
EditorInstance.getSelection().selectElement(Ele);
Ele.scrollIntoView();
4

2 回答 2

0

我已经尝试了下面的代码及其工作......

        Ele = EditorInstance.document.getById(Id);            

        EditorInstance.focus(); 
        var element = EditorInstance.document.getBody().getLast();
        var selection = EditorInstance.getSelection();
        selection.selectElement(Ele); 
        selection.scrollIntoView();
于 2012-11-22T12:53:43.300 回答
0

基于http://dev.ckeditor.com/ticket/7561 & http://dev.ckeditor.com/attachment/ticket/7561/7561.patch

像这样的补丁也可以..

Index: _source/plugins/selection/plugin.js
===================================================================
--- a/public/ckeditor-3.6.4/_source/plugins/selection/plugin.js
+++ b/public/ckeditor-3.6.4/_source/plugins/selection/plugin.js
@@ -710,7 +710,7 @@ For licensing, see LICENSE.html or http://ckeditor.com/license
                        }
                        catch ( e )
                        {
-                               this.isInvalid = true;
+                               document.getWindow().focus();
                        }
                }
于 2013-05-03T23:09:54.910 回答