ckeditor scrollIntoView到编辑器中的div元素 [英] ckeditor scrollIntoView to a div element within the editor

查看:582
本文介绍了ckeditor scrollIntoView到编辑器中的div元素的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个导航菜单外侧ckeditor,我想在编辑器中导航,因为我所有的元素在编辑器都有ids

I have a navigation menu out side ckeditor and i want to navigate within the editor as all my element in editor have ids

scrollIntoView

scrollIntoView

这如何工作

任何示例都会很好

推荐答案

此问题中的信息 (自己几个月前问)应该让你开始。
接受的答案概述了如何以编程方式从Jquery访问CKEditor文档中的元素。

The information in this question (asked by myself some months ago) should get you started. The accepted answer outlines how to access elements inside the CKEditor document programmatically from JQUery.

应该可以获取所需的元素,并根据它创建一个 ScrollIntoView

It should be possible to fetch the desired element, and do a ScrollIntoView based on that.

可能已经工作(未测试):

This might already work (untested):

var documentWrapper = editorname.document; // replace by your CKEDitor instance ID
var documentNode = documentWrapper.$; // or documentWrapper['$'] ;
documentNode.getElementById("id").scrollIntoView(); // Insert your element ID there

这篇关于ckeditor scrollIntoView到编辑器中的div元素的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆