JavaScript监听元素滚动并判断是否到达底部

$('#container .weui_actionsheet_menu').scroll(function () {
 var st = this.scrollTop;
 var height = this.clientHeight;
 var sh = this.scrollHeight;
       if (st + height >= sh){
           console.log("到底了..");
       }
});

body 元素请自测.

猜你喜欢

转载自fengjianrong.iteye.com/blog/2387778