我正在使用 jquery redactor,一切都很好,但我想让某些部分的行为像就地编辑编辑器。
我了解按钮的工作原理,例如:
var buttons = ['formatting', '|', 'bold', 'italic'];
$('#redactor').redactor({buttons: buttons});
并将按钮设置为:
var buttons = [];
所以没有按钮,但是工具栏仍然显示。
问题有没有办法删除工具栏和按钮?
最佳答案
如果您使用空数组设置buttons
,则使用默认设置:
['html', '|', 'formatting', '|', 'bold', 'italic', 'deleted', '|',
'unorderedlist', 'orderedlist', 'outdent', 'indent', '|',
'image', 'video', 'file', 'table', 'link', '|',
'fontcolor', 'backcolor', '|', 'alignment', '|', 'horizontalrule']
因此,您可以像这样设置工具栏
设置:
$('#redactor').redactor({
toolbar: false
});
如果您希望工具栏加载到编辑器的单独层中:
$('#redactor').redactor({
toolbarExternal: '#your-toolbar-id'
});
关于jquery - 没有工具栏的编辑器,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15849623/