如何设置和锁定CKEditor窗口大小
How to set and lock the CKEditor window size?
CKEditor创建一个默认大小的可调整大小的窗口。是否可以将窗口设置为我想要的大小并阻止其调整大小?
样式不起作用,包括文本区域标记中的显式样式或行属性。
jQuery也不起作用(使用它的高度函数)。
使用以下配置设置:
起始高度和宽度:
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
它告诉您每个设置允许的值和格式。
您可以在启动时设置编辑器的高度和宽度(仅限)-有配置选项height
和width
。
请参阅:CKEditor&JavaScript-在CKEditor 中调整高度和宽度
如果你想将高度(可能还有宽度)设置为百分比,这个CKEditor 3.0高度可能会很有趣。
更新:
巧合的是,我今天发现了这个:
/**
* 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 )
这意味着我认为编辑器的大小只能在启动时设置是不对的,但这并没有给问题增加任何内容:)。
相关文章:
- CKEditor Widget-阻止编辑可编辑元素本身
- Ckeditor-plugin:插入虚假元素add不情愿<p>标签前后
- CKEditor-我在editor.css中的风格是't
- CKeditor:更改对话框中的默认选择选项
- 删除CKEditor工具栏按钮,但不删除功能
- CKEditor v4:自制插件中对话框的动态标题
- 收听ckeditor小部件事件
- CKEditor如何允许href="javascript:void(0)"在小部件中
- Django可以'不能在设置中导入ckeditor,但可以在shell中导入
- 如何停止CKEditor用<br>
- 用CSS在CKEditor中设置预览样式
- CKeditor预览插件.js,为Chrome和IE进行编辑.因为它拒绝CSS样式
- HTML 标记未在 AngularJS ckEditor 中应用,而是在 Ediator 中显示 HTML 元素标记代码
- KeyDown event for CKeditor
- 删除CKEditor'中的htmlPreview;s图像插件
- 页面可见性API实际上支持操作系统屏幕锁定吗
- CKEditor中没有从计算机上传图像的选项
- 使用JavaScript锁定页面上的任何操作
- 如何设置和锁定CKEditor窗口大小
- 我可以使用 CKEDITOR 工具栏,但内容是锁定的/只读的