调整从 CDN 提供的 CKEditor 的大小
Resize CKEditor served from CDN
我已通过 CDN (https://cdn.ckeditor.com/) 将 CKEditor 添加到我的 PHP 项目以替换当前的文本区域。
我在适用文件的头部链接了它:
<script src="//cdn.ckeditor.com/4.5.8/standard/ckeditor.js"></script>
在我的 main.js 文件中,我替换了文本区域:
CKEDITOR.replace('message');
CKEDITOR.replace('address');
CKEDITOR.replace('note_message');
CKEDITOR.replace('reminder');
CKEDITOR.replace('save_the_date_message');
CKEDITOR.replace('thank_you_message');
//trial code
CKEDITOR.config.width = 600;
我已经搜索并尝试阅读文档,但无法弄清楚如何调整每个文本区域的 height/width。这是我文件中的当前外观:
任何有关如何解决此问题的见解都将不胜感激。
要改变它的大小,你只需要改变它的HTML代码。示例:
<textarea name="editor"></textarea>
在这段代码中,您有文本区域,要调整它的大小,请像这样使用 CSS:
<textarea name="editor" style="width:400px; height:500px;"></textarea>
或者:
<textarea name="editor1" width="400" height="500"></textarea>
但是,如果您想使用 javascript 调整大小,请使用此代码:
CKEDITOR.replace('editor', {
width: '400',
height: 500
});
真诚的,
卢卡斯·穆勒。
我已通过 CDN (https://cdn.ckeditor.com/) 将 CKEditor 添加到我的 PHP 项目以替换当前的文本区域。
我在适用文件的头部链接了它:
<script src="//cdn.ckeditor.com/4.5.8/standard/ckeditor.js"></script>
在我的 main.js 文件中,我替换了文本区域:
CKEDITOR.replace('message');
CKEDITOR.replace('address');
CKEDITOR.replace('note_message');
CKEDITOR.replace('reminder');
CKEDITOR.replace('save_the_date_message');
CKEDITOR.replace('thank_you_message');
//trial code
CKEDITOR.config.width = 600;
我已经搜索并尝试阅读文档,但无法弄清楚如何调整每个文本区域的 height/width。这是我文件中的当前外观:
任何有关如何解决此问题的见解都将不胜感激。
要改变它的大小,你只需要改变它的HTML代码。示例:
<textarea name="editor"></textarea>
在这段代码中,您有文本区域,要调整它的大小,请像这样使用 CSS:
<textarea name="editor" style="width:400px; height:500px;"></textarea>
或者:
<textarea name="editor1" width="400" height="500"></textarea>
但是,如果您想使用 javascript 调整大小,请使用此代码:
CKEDITOR.replace('editor', {
width: '400',
height: 500
});
真诚的, 卢卡斯·穆勒。