There is a need to determine whether the Web page in the IFRAME scroll to the bottom of the trigger event, the Internet to find a lot of information is said under the current page, simply on their own research, found a solution.
ClientHeight: The height of this element, taking up the height of the entire space
Offsetheight: Refers to the height of element content
ScrollTop: Can be understood as the length of the scroll bar can be scrolled
The following is the source code
Copy Code code as follows:
<iframe src= "~/files/3.html" id= "Iframepage" width= "825" onload= "Func" ( "></iframe>
<script type=" text/javascript ">
function func () {
var ifm = Document.getelem Entbyid ("Iframepage");
Ifm.height = window.document.body.clientheight-100;
}
<!--has compatibility issues with Chrome, FF and IE10 no problem, online said chrome access to the IFRAME in the server environment, do not know what the situation-->
Window.document.getElementById ("Iframepage"). Contentwindow.onscroll = function aaa () {
var IFM = document.getElementById ("Iframepage"). ContentWindow.document.documentElement;
if (ifm.scrolltop = = ifm.scrollheight-ifm.clientheight) {
Alert ("In the End");
}
}
</script>