jagu2020
jagu2020

Reputation: 43

CKEditor toolbar hide/show

I don't want to show the toolbar of CKEditor.

enter image description here

I tried:

HTML

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

Javascript

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

              allowedContent: true
} );

But then also it is showing the toolbar.

Upvotes: 1

Views: 2220

Answers (1)

Chirag Jain
Chirag Jain

Reputation: 1387

toolbarCanCollapse will not work in CKEDITOR.inline, use 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.

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

Upvotes: 2

Related Questions