CKEditor工具栏的隐藏/显示

问题描述 投票:1回答:1

我不想显示CKEditor的工具栏。

enter image description here

我尝试过:

HTML

<textarea id='a' name='a' ></textarea><br>

Javascript

CKEDITOR.inline( 'a', {
    toolbarCanCollapse : true,                  

              allowedContent: true
} );

但随后它也显示了工具栏。

javascript html ckeditor textarea toolbar
1个回答
1
投票

[toolbarCanCollapseCKEDITOR.inline中不起作用,请使用CKEDITOR.replace

[此外,toolbarCanCollapse不会自动隐藏工具栏,它只是工具栏右下角的一个按钮,有助于切换工具栏(隐藏/显示),默认情况下会显示工具栏,并显示toolbarCanCollapse被禁用。

尝试一下:

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.
});
© www.soinside.com 2019 - 2024. All rights reserved.