是否可以将 class 添加到自定义 tinyMCE 按钮?
Is it possible to add a class to a custom tinyMCE button?
我有一个网页,其中结合使用了 jQuery UI 和 tinyMCE。
我添加了一个自定义按钮,目的是使用此按钮拖动可拖动的文本字段:
代码:
editor.addButton('drag', {
text: 'Drag',
icon: false,
onclick: function() {
// somehow add the class '.handle' to the drag button
}
});
}
我可以向自定义 tinyMCE 拖动按钮添加一个 class“.handle”吗?或者这是不可能的。
您可以在设置中添加subtype
属性。
这将附加一个名称为 mce-[subtype]
的 class。
参考这个codepen
我有一个网页,其中结合使用了 jQuery UI 和 tinyMCE。 我添加了一个自定义按钮,目的是使用此按钮拖动可拖动的文本字段:
代码:
editor.addButton('drag', {
text: 'Drag',
icon: false,
onclick: function() {
// somehow add the class '.handle' to the drag button
}
});
}
我可以向自定义 tinyMCE 拖动按钮添加一个 class“.handle”吗?或者这是不可能的。
您可以在设置中添加subtype
属性。
这将附加一个名称为 mce-[subtype]
的 class。
参考这个codepen