The previous requirement was to determine whether the webpage in the iframe was scrolled to the bottom to trigger the event. I found a lot of information on the Internet, which is said to be under the current page. I simply studied it myself, the solution is found.
ClientHeight: height of the element, occupying the whole space
OffsetHeight: the height of the element content.
ScrollTop: it can be understood as the scroll length of a scroll bar.
Source code
Copy codeThe Code is as follows:
<Iframe src = "~ /Files/3.html "id =" iframepage "width =" 825 "onload =" func () "> </iframe>
<Script type = "text/javascript">
Function func (){
Var ifm = document. getElementById ("iframepage ");
Ifm. height = too many Doc ument. body. clientHeight-100;
}
<! -- There is a problem with chrome compatibility, and FF and IE10 are normal. The Internet says that chrome accesses iframe in the server environment and does not know what the situation is. -->
Specified parameter Doc ument. getElementById ("iframepage"). contentWindow. onscroll = function aaa (){
Var ifm = document. getElementById ("iframepage" 2.16.content#document.doc umentElement;
If (ifm. scrollTop = ifm. scrollHeight-ifm. clientHeight ){
Alert ("The End ");
}
}
</Script>