gregor
gregor

Reputation: 2457

CKEditor 4: Use links to anchors to navigate inside the editor

Is it possible to have a link-list with links to anchors (id's) outside the editor and when I click on a link the editor text should scroll to the given anchor id.

I tried to create a example with jsfiddle but I'm not able to embed the editor, when I get it I will post a example.

Upvotes: 0

Views: 1007

Answers (1)

oleq
oleq

Reputation: 15895

I think that CKEDITOR.dom.element.scrollIntoView() should do the trick:

CKEDITOR.instances.yourEditor.document.getById( 'someId' ).scrollIntoView();

Attach it to any element of your link-list, either with addEventListener or jQuery click function.

Upvotes: 0

Related Questions