JavaScript控制当滚动条到最底部时执行动作 首页 » 编程语言 » JavaScript控制当滚动条到最底部时执行动作 分享到各大社区 全屏 A <!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> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>无标题文档</title> <style> body{height:2000px;} </style> <script> window.onscroll=function(){ var scrollTop = document.documentElement.scrollTop||document.body.scrollTop; if(scrollTop>=document.body.offsetHeight-document.documentElement.clientHeight){ alert("执行动作"); } } </script> </head> <body> </body> </html> 标签:JavaScript 版权声明:若无特殊注明,本文皆为( VISAce )收集整理,版权归原作者所有。—— 李佳培.中国
发表评论
既然没有评论,那就赶紧抢沙发吧!