问题
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>
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
回答1:
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';
}
};
来源:https://stackoverflow.com/questions/9408707/changing-ckeditor-dimension-for-different-instances-not-all-instances