方式1:
0 注意:下面的代码是放在和iframe同一个页面中调用
1 //$(
"#iframeId"
).load(
function
() {
2
var
mainheight = $(
this
).contents().find(
"body"
).height() + 30;
3
$(
).height(mainheight);
4 });
方式2:
0 注意:下面的代码是放在iframe引用的子页面中调用
1 //$(window.parent.document).find(
main = $(window.parent.document).find(
);
thisheight = $(document).height() + 30;
4
main.height(thisheight);
5 });