Method One:
Copy Code code as follows:
$ (window.parent.document). Find ("#ContentIframe"). Load (function () {
var main = $ (window.parent.document). Find ("#ContentIframe");
var thisheight = $ (document). Height ();
if (Thisheight < 800)
Thisheight = 800;
Main.height (Thisheight);
});
This type of writing can only be loaded when the intrinsic elements of the adaptive height, when the element changes (such as the addition of a lot of elements, height changes) can not timely change the parent form of the iframe height.
Method Two:
Copy Code code as follows:
function Setmainheight () {
var main = $ (window.parent.document). Find ("#ContentIframe");
var thisheight = $ ("body"). Height ();
if (Thisheight <) {thisheight = 800;}
Main.height (THISHEIGHT+50);
SetTimeout (Setmainheight, 2000);
}
Add a timer to poll to determine the height of the child page changes.
All of the above 2 can be an IFRAME to achieve a highly adaptive, small partners according to their own project needs, free choice Bar