【发布时间】:2015-04-02 13:07:37
【问题描述】:
我在一个页面中使用了两个 CKEDITOR 的编辑器,而且我始终保持它们的大小相同。我正在使用自动增长插件,所以我尝试了一下:
CKEDITOR.plugins.addExternal( 'autogrow', location.href + 'ckeditor/autogrow/', 'plugin.js' );
var e1 = CKEDITOR.replace("heb_editor", {extraPlugins: 'autogrow'});
var e2 = CKEDITOR.replace("eng_editor", {extraPlugins: 'autogrow'});
e1.on("resize", r);
e2.on("resize", r);
function r(){
if($("#cke_1_contents").height() > e2.config.height)
$("#cke_2_contents").height($("#cke_1_contents").height());
else
$("#cke_1_contents").height($("#cke_2_contents").height());
}
没有用。它确实将第二个编辑器的大小调整为第一个的大小,但在需要时它没有将第一个编辑器的大小调整为第二个的大小。怎么办?
这是一个 JSfiddle:http://jsfiddle.net/povw33x7/
【问题讨论】:
-
如果我可以投入两分钱,CKEditor 4.5 将提供一种更简单的方法来解决这个问题,因为
resizeevent will pass new dimensions to the callback。敬请期待! -
@oleq 很遗憾我等不及了 :(
标签: javascript jquery ckeditor autogrow