使用redactor.js动态添加下拉元素

时间:2013-02-12 21:56:52

标签: redactor

我正在使用Redactor,需要动态添加元素到自定义下拉菜单。我在文档中找不到任何方法 - 有人知道这是否可行?

1 个答案:

答案 0 :(得分:1)

是的,你可以使用它:

$('#redactor').redactor({
   focus: true,
   buttonsAdd: ['|', 'button1'],
   buttonsCustom: {
      button1: {
         title: 'Button',
         callback: function(buttonName, buttonDOM, buttonObject) { /* … */ },
         dropdown: {
             alignleft: {
                title: lang.align_left,
                func: 'alignmentLeft'
             },
             aligncenter: {
                title: lang.align_center,
                func: 'alignmentCenter'
             }
         }
      }
   }
});
相关问题