写在开始的话
查遍的文献,没有找到js或者jquery定义好的方法可用,最后迫不得已自己写了个方法。(如果哪位同学知道有其他方法,欢迎讨论)
代码
???????????var count_index = 0; ???????????$(window).scroll( ???????????????function(e) { ???????????????????if(count_index == 0) { ???????????????????????var timeIntervalFunction = setInterval(function() { ???????????????????????????count_index--; ???????????????????????????if(count_index <= 0) { ???????????????????????????????console.log("scroll end = " + count_index); ???????????????????????????????clearInterval(timeIntervalFunction); ???????????????????????????????count_index = 0; ???????????????????????????} ???????????????????????}, 300); ???????????????????} ???????????????????count_index++; ???????????????} ???????????);
效果
? ?
? ?
? ?
友情链接:
技术博客 ???????简书主页