【问题标题】:Adding Custom button to tinymce editor将自定义按钮添加到 tinymce 编辑器
【发布时间】:2010-10-18 12:49:46
【问题描述】:

当我们为文本提供超链接时,<a> 标签将自动分配给文本。就像我如何将自己的标签赋予文本一样。所以我需要一个按钮工具栏,当我选择该按钮时,一个自定义标签将自动添加到选定的文本中。

【问题讨论】:

  • “自定义标签”是什么意思

标签: php tinymce


【解决方案1】:
【解决方案2】:
theme_advanced_buttons1 : "Tittle,phpimage,bold,italic,underline",    
setup : function(ed) {
            // Add a custom button
            ed.addButton('Tittle', {
                title : 'Tittle',
                image : './images/copy.jpg',
                onclick : function() {
                    // Add you own code to execute something on click
                    ed.focus();
                    ed.selection.setContent('<tittle>' + ed.selection.getContent() + '</tittle>');
                }
            });
        }

【讨论】:

    猜你喜欢
    • 2021-05-02
    • 2012-11-24
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-06-11
    • 2017-11-01
    相关资源
    最近更新 更多