我想在工具栏上添加一个按钮来调用 JavaScript 函数,例如Tada()
?
关于如何添加这个有什么想法吗?
还有一种很好的方法允许人们在不创建插件的情况下添加按钮。
html:
<textarea id="container">How are you!</textarea>
javascript:
editor = CKEDITOR.replace('container'); // bind editor
editor.addCommand("mySimpleCommand", { // create named command
exec: function(edt) {
alert(edt.getData());
}
});
editor.ui.addButton('SuperButton', { // add new button and bind our command
label: "Click me",
command: 'mySimpleCommand',
toolbar: 'insert',
icon: 'https://avatars1.githubusercontent.com/u/5500999?v=2&s=16'
});
在这里查看它是如何工作的:DEMO http://jsfiddle.net/2j3btvLo/291/
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)