With FCKEditor 2.x. I can set editor css like this:
EditorDocument is not a valid object in CKEditor 3.1, but according to the docs, I should be able to change CSS on the fly like this:
When this is called, I get an "'element' undefined" error.
I've also tried grabbing the editor ID with these:
These also generate 'element' undefined errors.
The myElement text box was created with this:
I don't know what else to try.
Developers, could you please lend a hand? Kind thanks.
fckeditorInstance.EditorDocument.body.style.cssText += 'background-color: #FFFFFF;' ;
EditorDocument is not a valid object in CKEditor 3.1, but according to the docs, I should be able to change CSS on the fly like this:
var element = CKEDITOR.dom.element.getById( 'myElement' ); element.setStyle( 'background-color', '#ff0000' );
When this is called, I get an "'element' undefined" error.
I've also tried grabbing the editor ID with these:
var element = new CKEDITOR.dom.element( document.getElementById( 'comments' ) ); var element = CKEDITOR.document.getById( 'comments' );
These also generate 'element' undefined errors.
The myElement text box was created with this:
(via PHP API) $config = array(); $config['toolbar'] = array( array( 'Bold', 'Italic', 'Underline', 'Strike', '-', 'Source' ) ); $CKEditor = new CKeditor() ; $CKEditor->basePath = '/includes/ckeditor/' ; $CKEditor->returnOutput = true; $CKEditor->config['skin'] = 'v2'; $CKEditor->config['height'] = 150; $CKEditor->config['width'] = 400; $CKEditor->config['resize_enabled'] = false; $html_input_comments = $CKEditor->editor('myElement', $mySavedData, $config, $events);
I don't know what else to try.
Developers, could you please lend a hand? Kind thanks.
Re: CKEditor ID - how do I get this?