ckeditor对话框定位 [英] ckeditor dialog positioning
本文介绍了ckeditor对话框定位的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
CKEditor的对话框窗口默认显示在页面的中间,但如果页面是一个大的高度的iframe,对话框会出现在页面下方。
Dialog windows for CKEditor by default appear in the middle of the page but if the page is an iframe with a big height the dialogs appear way down the page.
是否可以配置CKEditor将对话框放置在页面的不同象限中?例如顶部中间?
Is it possible to configure CKEditor to position the dialogs in a different quadrant of the page? For example top middle?
推荐答案
是的,MDaubs给出的链接将指导你做你想做的事。
Yes, the link MDaubs gives will guide you to do what you want.
我不得不在过去这样做,以下代码段将展示您的问题的解决方案:
I've had to do this in the past and the following snippet will demonstrate a solution for your problem:
CKEDITOR.on('dialogDefinition', function(e) {
var dialogName = e.data.name;
var dialogDefinition = e.data.definition;
dialogDefinition.onShow = function() {
this.move(this.getPosition().x,0); // Top center
}
})
您可以将它放在配置文件或jQuery的ready函数中。
You can place this in the config file or the ready function for jQuery.
这篇关于ckeditor对话框定位的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文