The javascript Implementation Framework highly changes with the content, and the javascript implementation framework
This example describes how to change the height of the javascript framework with the content. Share it with you for your reference. The details are as follows:
There are two methods:
1. changed through the parent page
Here, we need to understand that the two attributes of the framework, contentWindow and contentDocument, have the same meaning as the two attributes of the window document. The difference is that all the browsers of contentWindow support the content, such as contentDocument ie6 and 7, and chrome does not support the content.
<Iframe onload = "change_height ()"> </iframe> function change_height () {var iframe = document. getElementById ("iframe_id"); // get the framework element var I _height1_iframe.content?#doc ument. body. scrollHeight | iframe.content1_document.doc umentElement. scrollHeight; // obtain the height of the frame content iframe. height = I _height; // change}
2. Content Change
On the content page
Window. onload = function () {var iframe=parent.doc ument. getElementById ("iframe_id"); // get the frame element iframe. height = document. body. scrollHeight | document.doc umentElement. scrollHeight; // obtain and change the height of the framework content}
I hope this article will help you design javascript programs.