0
iframeの親ウィンドウにアクセスして、iframeの高さを設定しようとしています。Mac Google Chrome iframeアクセス先の親ウィンドウ
次のコードは、Windows IE7/IE8/Chrome/FireFox 3.6およびMac FireFox/Safariで動作します。
しかし、Mac Chrome親ウィンドウにアクセスしているようには見えません。 Iframe.htmlので
<iframe src="iframe_saleinfo.html" id="saleInformationIframe" frameborder="0"></iframe>
:
$(document).ready(function() {
var theFrame = $('#saleInformationIframe', window.top.document);
theFrame.height($(document.body).height() + 30);
});
私も試してみました:親ページで
は、私は、IFRAME持っ$(document).ready(function() {
var theFrame = $('#saleInformationIframe', top.document);
theFrame.height($(document.body).height() + 30);
});
をそして私が試してみました:
$(document).ready(function() {
var theFrame = $('#saleInformationIframe', parent.document.body);
theFrame.height($(document.body).height() + 30);
});
そして、私が試した:事前に
$(document).ready(function() {
var theFrame = $('#saleInformationIframe', window.parent.document);
theFrame.height($(document.body).height() + 30);
});
おかげで、
Jayde。