2010-11-24 5 views
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.

답변

0

Chrome Mac의 로컬 문제인 것 같습니다. 테스트 용 Mac에 웹 서버가 설치되어 있지 않지만 서버에 파일을 업로드하고 거기에서 볼 때 모든 것이 제대로 작동하는 것처럼 보입니다.

감사합니다.

Jayde.