Skip to content Skip to sidebar Skip to footer

Scroll To The Bottom Of Ckeditor

any ideas on how to scroll to bottom of a ckeditor editor using javascript / jQuery? I cant find anything. All my search shows is: document.getElementById('ID').contentWindow.scrol

Solution 1:

Access the editor and get the editable area via that instead of getting the DOM element directly. Like so:

var editor = CKEDITOR.instances.editor1; 
var jqDocument = $(editor.document.$);
var documentHeight = jqDocument.height();
jqDocument.scrollTop(documentHeight);

This works in the Demo: http://ckeditor.com/demo (you need var $ = jQuery; if you try it in the console).

Note that your editor might not be named "editor1" - use the appropriate name for you.


Post a Comment for "Scroll To The Bottom Of Ckeditor"