简体   繁体   English

CKEditor 工具栏隐藏/显示

[英]CKEditor toolbar hide/show

I don't want to show the toolbar of CKEditor.我不想显示 CKEditor 的工具栏。

在此处输入图像描述

I tried:我试过了:

HTML HTML

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

Javascript Javascript

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

              allowedContent: true
} );

But then also it is showing the toolbar.但随后它也显示了工具栏。

toolbarCanCollapse will not work in CKEDITOR.inline , use CKEDITOR.replace . toolbarCanCollapseCKEDITOR.inline中不起作用,请使用CKEDITOR.replace

Also, toolbarCanCollapse will not hide the toolbar automatically, it is just a button at the bottom-right corner in the toolbar, which helps to toggle the toolbar (Hide/Show), by default toolbar is shown and toolbarCanCollapse is disabled.此外, toolbarCanCollapse不会自动隐藏工具栏,它只是工具栏右下角的一个按钮,有助于切换工具栏(隐藏/显示),默认情况下显示工具栏并禁用toolbarCanCollapse

Try this:尝试这个:

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.
});

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM