← 全部文档

editor.createToolbarDropDown

在工具栏中创建一个使用默认样式的下拉菜单。详情请参阅插件示例。

语法

editor.createToolbarDropDown(option,cmdname)

参数

类型:object

选项对象用于设置 fillinput 和 fillpanel。

类型:String

命令名称。

参数

类型:HTMLElement

工具栏下拉菜单。

用法示例

var editor1 = new RichTextEditor("#div_editor1");
var option={}
option.fillinput=function(span){span.innerText='select..'}
option.fillpanel=function(panel){panel.style.width='80px';panel.innerHTML='<div>a</div><div>b</div>'}
var dropdown=editor1.createToolbarDropDown(option,"mycmd");
editor1.container.parentNode.insertBefore(dropdown,editor1.container);