怎样判断滚动条已到最底部?

zou_wei_forever 2009-11-02 11:18:06
RT!
...全文
179 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
sohighthesky 2009-11-02
  • 打赏
  • 举报
回复
[Quote=引用 1 楼 ltnrain 的回复:]
if(scrollTop+clientHeight==scrollHeight){
alert('到达底部');
}
[/Quote]
obj.scrollTop+obj.clientHeight>=obj.scrollHeight
草根醉秋意 2009-11-02
  • 打赏
  • 举报
回复
if(scrollTop+clientHeight==scrollHeight){
alert('到达底部');
}
sohighthesky 2009-11-02
  • 打赏
  • 举报
回复
[Quote=引用 3 楼 zou_wei_forever 的回复:]
解决了,顺便问问,到最顶端得条件是?
[/Quote]
obj.scrollTop==0;
zou_wei_forever 2009-11-02
  • 打赏
  • 举报
回复
[Quote=引用 1 楼 ltnrain 的回复:]
if(scrollTop+clientHeight==scrollHeight){
alert('到达底部');
}
[/Quote]


[Quote=引用 2 楼 sohighthesky 的回复:]
引用 1 楼 ltnrain 的回复:
if(scrollTop+clientHeight==scrollHeight){
alert('到达底部');
}

obj.scrollTop+obj.clientHeight>=obj.scrollHeight
[/Quote]

解决了,顺便问问,到最顶端得条件是?

87,994

社区成员

发帖
与我相关
我的任务
社区描述
Web 开发 JavaScript
社区管理员
  • JavaScript
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧