我有一個頁面中的iFrame,我想要一個JQuery對話框居中父母,而不是iFrame。在頁面上的iFrame內的父級中心jQuery對話框
我不能找到一種方法,但做到這一點...
當我運行單獨的iFrame網頁此工程:
var LLopt = {
position: {my: "center center", at: "center center", of: parent.top}
};
$("#locationdisplaybox").dialog(LLopt).dialog("open");
...但是當我嘗試內運行它父母,我沒有在控制檯中得到錯誤,但它不運行(就像有一個看不見的錯誤)。
我相信這是因爲從iFrame訪問父級的安全限制。
如果我運行上面沒有「of:window.parent.top」,如果工作正常,但我在iFrame頁面中較低,則對話框出現的較低(不居中)。
有沒有人知道我可以如何居中?
要查看問題所在,請點擊please see here,然後點擊一些「查看場地詳情」鏈接。
您可以在http://jsfiddle.net中創建一個簡化版本來演示問題嗎? –
@iKode iFrame需要與父頁面的寬度一樣寬。 無法打開比iframe更寬的模式。 – hitautodestruct
[圖片說明](http://tinypic.com/r/evb4eq/5) – hitautodestruct