私は多くの解決策を試しましたが、私のサイトではうまくいきません。
今私は使用します:
<iframe src="http://www.travelstoremaker.com/ibe/turismoin/porch?command=flights" frameborder="0" marginwidth="0" marginheight="0" width="906" height="5000"></iframe>
ここで見ることができます: http://turismo-in.it/voli-in-italia/
今、私はこれを見つけました:
var transport = new easyXDM.transport.BestAvailableTransport({
local: "../hash.html",
remote: "http://provider.easyxdm.net/example/resized_iframe.html",
container: document.getElementById("element_that_should_contain_the_frame"),
onMessage: function(message, origin){
this.container.getElementsByTagName("iframe")[0].style.height = message + "px";
}
});
そして、コンテンツの後に iframes 本文に次を入れます
var transport = new easyXDM.transport.BestAvailableTransport({}, function(){
transport.postMessage(document.body.scrollHeight);
});
しかし、それを行う方法は?どこに追加する必要がありますか? できます?!クロスドメインで iframe の高さを自動的にサイズ変更するソリューションはありますか?
PS iframed ページのコードは変更できませんが、自分のサイトでのみ変更できます