我已从CKEditor
工具栏中删除了打印按钮...现在我希望打印按钮位于CKEditor
旁边的另一个div标签中的CKEditor
之外。 ..我希望打印按钮具有CKEditor
打印按钮中使用的按钮图像...按钮的config.js
代码:
config.toolbar = [
{ name: 'clipboard', groups: [ 'clipboard', 'undo' ], items: [ 'PasteText', 'Undo', 'Redo' ] },
{ name: 'editing', groups: [ 'find', 'selection', 'spellchecker' ], items: [ 'Find', 'Scayt' ] },
{ name: 'colors', items: [ 'TextColor', 'BGColor' ] },
{ name: 'styles', items: [ 'Font' ] },
{ name: 'styles', items: [ 'FontSize' ] },
{ name: 'links', items: [ ] },
{ name: 'basicstyles', groups: [ 'basicstyles', 'cleanup' ], items: [ 'Bold', 'Italic', 'Underline', 'Strike', 'Subscript', 'Superscript' ] },
{ name: 'document', groups: [ 'mode', 'document', 'doctools' ], items: [ ] }, //Print , Templates
{ name: 'paragraph', groups: [ 'list', 'indent', 'blocks', 'align', 'bidi' ], items: [ 'NumberedList', 'BulletedList', 'Outdent', 'Indent', 'Blockquote', 'JustifyLeft', 'JustifyCenter', 'JustifyRight', 'JustifyBlock', 'BidiLtr', 'BidiRtl', 'language' ] },
{ name: 'insert', items: [ 'Image', 'Table', 'PageBreak' ] },
{ name: 'styles', items: [ 'Styles'] },
{ name: 'styles', items: [ 'Format'] },
];
我怎么能做我上面说的那些......?任何帮助将不胜感激...提前感谢.. :))
答案 0 :(得分:3)
您可以直接参考打印命令。尝试像这样的HTML和Javascript
<div onclick="ckePrint()">Click to print</div>
<script type="text/javascript">
function ckePrint() {
// Replace "editor1" with your editor name
var i = CKEDITOR.instances.editor1;
// Edited as per the comment by Reinmar
i.editor.execCommand( 'print' );
}
</script>