jquery - 从编辑器所见即所得中删除按钮

标签 jquery wysiwyg redactor

这是我的代码:

http://jsfiddle.net/KfVJK/

这是添加编辑器的代码:

$(document).ready(
            function()
            {
                $('#redactor_content').redactor();
            }
        );​

我想限制工具栏上的按钮数量。例如,只有基本格式,如粗体、斜体等。

如何从工具栏中删除按钮?

最佳答案

使用按钮设置:

var buttons = ['formatting', '|', 'bold', 'italic'];

$('#redactor').redactor({buttons: buttons});

这是摘自documentation :

By default, this setting contains the following array of toolbar's buttons:

['html', '|', 'formatting', '|', 'bold', 'italic', 'deleted', '|', 
'unorderedlist', 'orderedlist', 'outdent', 'indent', '|',
'image', 'video', 'file', 'table', 'link', '|',
'fontcolor', 'backcolor', '|', 'alignment', '|', 'horizontalrule']

// additional buttons
// 'underline', 'alignleft', 'aligncenter', 'alignright', 'justify'
// If you wish to set your own array, set it in this option:

$('#redactor').redactor({
    buttons: ['html', '|', 'formatting', '|', 'bold', 'italic'] 
});

关于jquery - 从编辑器所见即所得中删除按钮,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13048128/

相关文章:

javascript - 以正确的方式将 JQuery 与 Wordpress 结合使用?

jquery - 函数名中使用的变量

javascript - Bootstrap 下拉菜单在折叠时无法定位

jquery - 没有工具栏的编辑器

xml - 如何将 xml symfony 服务文件转换为 yaml

javascript - Chart.js 从 x/y 轴移除边框

reactjs - 无法将 Lexical 解析为 HTML

django - django 最好的所见即所得编辑器是什么?

javascript - 如何清理从所见即所得编辑器收到的数据?

vue.js - 将 Vue 与编辑器一起使用