How to set and lock the window size of CKEditor?

CKEditor creates a default window resizing. Is it possible to set the window to the desired size and not change it?

Styles do not work, including the explicit attribute of the style or lines in the textarea tag.

jQuery also does not work (with its height function).

+4
source share
2 answers

Use these configuration settings:

Initial height and width:

config.height = '111px'; config.width = 111; 

Is it possible to resize the CkEditor window:

 config.resize_enabled = false; //false says not resizable 

You can allow resizing, but control the direction (vertical or horizontal) and the minimum and maximum values.

 config.resize_dir = 'vertical'; //Can use (both, vertical, and horizontal) 

Height:

 config.resize_maxHeight = 111; config.resize_minHeight = 111; 

width:

 config.resize_maxWidth = 111; config.resize_minWidth = 111; 

The CkEditor API for configuration settings is located here:
API CKEDITOR.config

It tells you the allowed values ​​and formatting for each setting.

+12
source

You can set the height and width of the editor at startup (only) - there are configuration options for height and width .

See: CKEditor and JavaScript - adjust height and width in CKEditor

This CKEditor 3.0 Height may be of interest if you want to set the height (and possibly width) as a percentage.

UPDATE:

Coincidentally, I found this today:

 /** * Resizes the editor interface. * @param {Number|String} width The new width. It can be an pixels integer or a * CSS size value. * @param {Number|String} height The new height. It can be an pixels integer or * a CSS size value. * @param {Boolean} [isContentHeight] Indicates that the provided height is to * be applied to the editor contents space, not to the entire editor * interface. Defaults to false. * @param {Boolean} [resizeInner] Indicates that the first inner interface * element must receive the size, not the outer element. The default theme * defines the interface inside a pair of span elements * (<span><span>...</span></span>). By default the * first span element receives the sizes. If this parameter is set to * true, the second span is sized instead. * @example * editor.resize( 900, 300 ); * @example * editor.resize( '100%', 450, true ); */ CKEDITOR.editor.prototype.resize = function( width, height, isContentHeight, resizeInner ) 

This means that I'm wrong that the size of the editor can be set only at startup, but it does not add anything to the question :).

+3
source

All Articles