日期:2014-05-16 浏览次数:20402 次
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title></title> </head> <body > <div style="margin-top: 1px; background-color: red;" onclick="ec();"> a 1x</div> <div style="margin-top: 800px; background-color: red;" onclick="ec();"> b 800x</div> <div style="margin-top: 1600px; background-color: red;" onclick="ec();"> c 1600x</div> <script type="text/javascript"> window.onscroll = function () { var a = document.documentElement.scrollTop == 0 ? document.body.clientHeight : document.documentElement.clientHeight; var b = document.documentElement.scrollTop == 0 ? document.body.scrollTop : document.documentElement.scrollTop; var c = document.documentElement.scrollTop == 0 ? document.body.scrollHeight : document.documentElement.scrollHeight; if (b != 0) { if (a + b == c) { showmore(); } } } function showmore() {alert('aa');} </script> </body> </html>