ckeditor焦点不工作

时间:2014-04-30 16:12:30

标签: javascript jquery ckeditor

尝试用ckeditor和jquery做一个简单的焦点命令。

var foo = // what can i do here to signal ckeditor?
$(foo).focus(function(){
  $(".class1").hide();
  $(".class2").show();
});

也许这很简单,我只是忽略它,但任何建议或链接都​​非常感激。

尝试过:
CKEditor on focus remove default value
How to listen to basic events in CKEditor?
http://docs.ckeditor.com/#!/api/CKEDITOR.focusManager-method-constructor
http://www.mytechlogy.com/professionals/questions/forum-details/158/how-to-make-focus-in-ckeditor-using-js/?ref=related_posts#.U2EgUv3z3eI
http://ckeditor.com/forums/Support/jquery-click-event-not-working-textarea-ckeditor

1 个答案:

答案 0 :(得分:3)

CKEditor活动的基本理念

CKEDITOR.on('instanceCreated', function (event) {
    event.editor.on("focus", function () {  //nothing to do with jQuery, this is CKEDITOR's on
        $(".class1").hide();
        $(".class2").show();
    }
);

CKEDITOR.instances["editorID"].on("focus", function(){  //CKEDITOR's ON
    $(".class1").hide();
    $(".class2").show();
} );