更改不同实例(不是所有实例)的ckeditor维度 [英] changing ckeditor dimension for different instances (not all instances)
本文介绍了更改不同实例(不是所有实例)的ckeditor维度的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我试图在textarea之后使用此代码在同一页面中更改多个ckeditor的维度
i'm trying to change dimensions for multiple ckeditor in the same page using this code just after the textarea
<script type="text/javascript">
CKEDITOR.config.width ='250px';
CKEDITOR.config.height='600px';
</script>
它会更改页面中的所有实例,我知道如何调整config.js中的默认值,我试图改变一些实例的尺寸不是所有的
it changes all instances in the page and i know how to adjust default values in the config.js but i'm trying to change dimensions for some instances not all of them
推荐答案
如果你需要改变特定实例的高度的CKEditor,所有你可以改变的是 config.js
,那么你可以使用 this.name
在配置文件中检测编辑器的正确实例:
If you ever need to change the height of specific instance of CKEditor and all you can change is config.js
, then you can use this.name
inside configuration file to detect the right instance of the editor:
CKEDITOR.editorConfig = function( config ) {
// Default height for all instances
config.height = '400';
// Height for specific instance, the ID of textarea is "editor1"
if (this.name == 'editor1') {
config.height = '200';
}
};
这篇关于更改不同实例(不是所有实例)的ckeditor维度的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文