2
CKEditor 4可以在“内嵌编辑器”模式下使用,只要相关文本区域获得焦点,它就会显示一个工具栏。我需要隐藏工具栏,并且只在用户选择一些文本时才显示它,我该怎么做?CKEDITOR内嵌编辑器工具栏文本选择
我想知道如何重新定位工具栏。
CKEditor 4可以在“内嵌编辑器”模式下使用,只要相关文本区域获得焦点,它就会显示一个工具栏。我需要隐藏工具栏,并且只在用户选择一些文本时才显示它,我该怎么做?CKEDITOR内嵌编辑器工具栏文本选择
我想知道如何重新定位工具栏。
你可以尝试这样的事:
$('#showEditor').mouseup(function() {
if(getSelectedText()){
//show inline editor instance
CKEDITOR.disableAutoInline = true;
var editor = CKEDITOR.inline(document.getElementById('showEditor'));
}
});
function getSelectedText() {
var t = '';
if (window.getSelection) {
t = window.getSelection();
} else if (document.getSelection) {
t = document.getSelection();
} else if (document.selection) {
t = document.selection.createRange().text;
}
return t;
}
问题编辑请查看和更改状态为开(@andrewsi) – RGA 2015-01-06 06:51:38