javascript 및 Jquery를 사용하여 iframe의 높이를 동적으로 설정하려고합니다.동적으로 iframe 높이를 설정합니다. ie 및 chrome에서 작동하지 않습니다.
그러나 이것이 Ie8에서 작동하지 않는 이유는 & 크롬입니다. (하지만 파이어 폭스에서 잘 작동 함)
일부 신체는 도움을받을 수 있습니까?
감사
function resizePanel() {
window.console.log("ran the resize panel function");
var frame = document.getElementsByTagName('iframe')[0];
if(frame != null) {
var height;
if(self.innerHeight) {
window.console.log("ran the self.innerHeight");
height= self.innerHeight;
}
else if (document.documentElement && (document.documentElement.clientHeight)) {
window.console.log("ran the clientHeight");
height = document.documentElement.clientHeight;
}
else if(document.body) {
window.console.log("ran the document.body");
height = document.body.clientHeight;
}
frame.style.height = height - 165 + 'px'
}};
$(document).ready(function() {
resizePanel();
$(window).resize(function() {
resizePanel();
});
});
var prm = Sys.WebForms.PageRequestManager.getInstance();
prm.add_endRequest(EndRequest);
function EndRequest(sender, args) {
resizePanel();
}