没有工具栏的编辑器
问题描述:
我正在使用jquery编辑器,所有的都很好,但我想让一些部分的行为像编辑就地编辑器一样。没有工具栏的编辑器
我理解按钮的工作原理例如为:
var buttons = ['formatting', '|', 'bold', 'italic'];
$('#redactor').redactor({buttons: buttons});
,并且已经设置按钮:
var buttons = [];
所以没有任何按键,但是,工具栏仍显示。
问题有没有办法删除工具栏以及按钮?
答
是的,它是可能的,与toolbar
财产的帮助:
$('#redactor').redactor({toolbar: false});
答
如果你有一个空数组设置buttons
您使用默认设置:
['html', '|', 'formatting', '|', 'bold', 'italic', 'deleted', '|',
'unorderedlist', 'orderedlist', 'outdent', 'indent', '|',
'image', 'video', 'file', 'table', 'link', '|',
'fontcolor', 'backcolor', '|', 'alignment', '|', 'horizontalrule']
所以,你可以设置toolbar
像这样设置:
$('#redactor').redactor({
toolbar: false
});
如果你想在工具栏加载从编辑单独的图层:
$('#redactor').redactor({
toolbarExternal: '#your-toolbar-id'
});
答
从文件拖动一个div后,我想重点可编辑的编辑器。 如何触发redactor可编辑区域的焦点功能?
我想:
$('#'+maskId).draggable({
containment: '#content',
drag: function(){
// ...
},
stop: function() {
$('#'+redactorTextareaId).redactor({
focus: true
});
}
});
和:
$('#'+maskId).draggable({
containment: '#content',
drag: function(){
// ...
},
stop: function() {
$('#'+redactorTextareaId).focus();
}
});