2012-07-16 133 views
4

CKEditor创建一个默认大小的可调整大小的窗口。是否可以将窗口设置为我想要的大小并防止它被调整大小?如何设置和锁定CKEditor窗口大小?

样式不起作用,包括textarea标签中的显式样式或行属性。

jQuery也不起作用(有它的高度功能)。

回答

12

使用这些配置设置:

开始高度和宽度:

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

是在CKEDITOR窗口调整大小:

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

你可以让它成为可调整大小,但控制方向(垂直或水平)和最小值和最大值。

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

身高:

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

宽度:

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

的CKEDITOR API的配置设置是在这里:
CKEDITOR.config API

它告诉你的允许值和格式每个设置。

3

您可以在启动时设置编辑器的高度和宽度(仅) - 有配置选项heightwidth

看到这个:CKEditor & JavaScript - Adjust height and width in CKEditor

这一个CKEditor 3.0 Height可能是有趣的,如果你想设置的高度(宽度和也许是太)的百分比。

UPDATE:

巧合的是今天我发现这一点:

/** 
* 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) 

这意味着,我是不是正确的,编辑器的大小只能在启动时进行设置,但它不添加任何问题以及:)。

相关问题