【问题标题】:CKEditor toolbar hide/showCKEditor 工具栏隐藏/显示
【发布时间】:2020-04-25 14:18:13
【问题描述】:
我不想显示CKEditor的工具栏。
我试过了:
HTML
<textarea id='a' name='a' ></textarea><br>
Javascript
CKEDITOR.inline( 'a', {
toolbarCanCollapse : true,
allowedContent: true
} );
但它也显示工具栏。
【问题讨论】:
标签:
javascript
html
ckeditor
textarea
toolbar
【解决方案1】:
toolbarCanCollapse 在CKEDITOR.inline 中不起作用,请使用CKEDITOR.replace。
另外,toolbarCanCollapse 不会自动隐藏工具栏,它只是工具栏右下角的一个按钮,有助于切换工具栏(隐藏/显示),默认显示工具栏和@987654325 @ 已禁用。
试试这个:
CKEDITOR.replace('a', {
toolbarCanCollapse: true, //Button to toggle toolbar (show/hide)
toolbarStartupExpanded: false, //This will hide toolbar by default.
height: "60px" //I just gave the height if you want textarea to be small, just like it is in CKEDITOR.inline.
});