CKeditor上的Jquery事件 [英] Jquery events on CKeditor

查看:108
本文介绍了CKeditor上的Jquery事件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好
在文本区域的ID为ckeditor_input的表单中

Hello in a form with a textarea with id "ckeditor_input"

$("#ckeditor_input").ckeditor();

$("#ckeditor_input").html(); // can get the value

("#ckeditor_input").click/blur/keydown/keypressed(

   function(){
         alert("OK");
  }
); //doesn't work!

问题是ckeditor!如果我没有启动ckeditor的一个实例在textarea所有事件工作正常!

the problem is ckeditor! If I don't start an instance of ckeditor on the textarea all events work fine! What is the right way to get events on a ckeditor instance?

谢谢

推荐答案

CKEditor使用iframe ...非常讨厌jQuery事件。您可以尝试:

CKEditor uses an iframe... very annoying for jQuery events. You could try:

$($('#parent-element>iframe').get(0).contentWindow.document).live('click',function() { ... });

我没有测试它,所以不完全确定它是否可以工作。但我相信这是解决方案的起点。让我知道它是怎么回事,如果它不工作,我会尝试和解决问题是什么。

I haven't tested it so not entirely sure whether it'll work. But I'm sure that's the starting point for the solution. Let me know how it goes, and if it doesn't work I'll try and work out what the problem is.

: (基于注释)

$(CKEDITOR.instances.desc_product).click(function() { ... });

我认为应该这样做。但是只有在CKEditor正确加载后才运行它。

I think that should do it. But only run it after CKEditor has loaded properly.

这篇关于CKeditor上的Jquery事件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆