【问题标题】:Change colors option on popline projectpopline项目上的更改颜色选项
【发布时间】:2013-09-20 15:28:45
【问题描述】:

我想知道如何在 popline 项目中添加更改颜色的可能性。

https://github.com/kenshin54/popline

我需要编写类似https://github.com/kenshin54/popline/tree/master/scripts/plugins 之一的插件

但我失败了

【问题讨论】:

    标签: jquery jquery-plugins open-source


    【解决方案1】:

    我想通了:

    ;(function($) {
      $.popline.addButton({
        justify: {
          iconClass: "icon-pencil red",
          mode: "edit",
          buttons: {
            justifyLeft: {
              iconClass: "icon-tint green",
              action: function(event) {
                document.execCommand('ForeColor', false, '#468858');
              }
            },
    
            justifyCenter: {
              iconClass: "icon-tint red",
              action: function(event) {
                document.execCommand('ForeColor', false, '#a74240');
              }
            },
    
            justifyRight: {
              iconClass: "icon-tint grey",
              action: function(event) {
                document.execCommand('ForeColor', false, '#8f8f8f');
              }
            },
    
            indent: {
              iconClass: "icon-tint orange",
              action: function(event) {
                document.execCommand('ForeColor', false, '#c99a4a');
              }
            },
    
            outdent: {
              iconClass: "icon-tint blue",
              action: function(event) {
                document.execCommand('ForeColor', false, '#2d6987');
              }
            }
          }
        }
      });
    })(jQuery);
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2017-06-19
      • 1970-01-01
      • 2013-06-03
      • 2015-12-06
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-10-14
      相关资源
      最近更新 更多