iframe中的JQuery UI Dialog [英] JQuery UI Dialog inside of an iframe

查看:281
本文介绍了iframe中的JQuery UI Dialog的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发一个sp2013应用,这意味着它正在使用iframe。具体来说,它是一个非常大的iframe占据了大部分屏幕。在很多方面,我正在打开jquery ui对话框窗口。它们被设置为显示在视口的中间,这很好,除了它显示在iframe的中间,而不是显示在可见屏幕的中间。

I'm developing a sp2013 app, which means it's using iframes. Specifically, it's a very large iframe which takes up most of the screen. At many points, I'm opening up jquery ui dialog windows. They are set to appear in the middle of the viewport, which is great, except it's showing up in the middle of the iframe, rather than the middle of the visible screen.

有没有办法告诉jquery ui查看window.top的滚动属性,而不是iframe?

Is there a way I can tell jquery ui to look at window.top's scroll properties, instead of the iframes?

编辑:iframe和父级是同一个域,所以跨域问题不是问题。

The iframe and the parent are on the same domain, so cross-domain issues aren't a problem.

推荐答案

好的,所以我找到了解决方案。在声明我的对话框时,我执行了以下操作:

Okay, so I found the solution. When declaring my dialog, I did the following:

$("selector").dialog({
    position: {my: "center", at: "center", of: window.top}
});

这篇关于iframe中的JQuery UI Dialog的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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