【问题标题】:wysihtml5 bootstrap3-wysiwyg font size and <p> to <br>wysihtml5 bootstrap3-wysiwyg 字体大小和 <p> 到 <br>
【发布时间】:2015-04-05 10:52:45
【问题描述】:

我基于wysihtml5使用bootstrap3-wysiwyg

我寻求解决方案

  1. 在“Enter”键上插入“br”而不是“p”

  2. 用输入值改变字体大小的按钮

【问题讨论】:

    标签: wysihtml5 bootstrap-wysihtml5


    【解决方案1】:
    1. 使用“br”
    $("#TextContent").wysihtml5({useLineBreaks: true, ...})
    
    1. 字号
      var myCustomTemplates = {
    
        custom1: function (context) {
            var s = ""
            s += '<li class="dropdown">';
            s += '<a class="btn btn-default dropdown-toggle" data-toggle="dropdown" tabindex="-1" aria-expanded="false">';
            s += '<span class="current-color">Size</span>';
            s += '<b class="caret"></b>';
            s += '</a>';
            s += '<ul class="dropdown-menu" style="margin-top: 0px;">';
            s += '<li><a class="fontSize" data-wysihtml5-command="fontSize" data-wysihtml5-command-value="fs5">5px</a></li>';
            s += '</ul>';
            s += '</li>';
    
            return s;
        }
    };
    
     $("#TextContent").wysihtml5(
            {
                customTemplates: myCustomTemplates,
                "stylesheets": ["~/Content/wysiwyg/editor.css"]
            });
    

    editor.css

    .wysiwyg-font-size-fs5 {
        font-size: 5px;
    }
    

    【讨论】:

      猜你喜欢
      • 2020-08-25
      • 2021-02-16
      • 2018-07-05
      • 1970-01-01
      • 1970-01-01
      • 2012-05-07
      • 2018-07-11
      • 1970-01-01
      • 2012-11-26
      相关资源
      最近更新 更多