首页 > 微信 > 详细

coffeescript写的一个无限下拉小程序

时间:2018-08-08 14:25:07      阅读:174      评论:0      收藏:0      [点我收藏+]
locate=$(document).height()-$(window).height()
times=0
scroller = (cb)->
  if locate<=$(document).height()-$(window).height()
    times=0
    locate+=100
    scroll(0,locate)
    clearTimeout(timer)
    timer=setTimeout("scroller()",54)
    timer
  else
    await sleep 3000, defer()
    times++
    console.log times
    return if times>3
    scroller()
scroller()

 

coffeescript写的一个无限下拉小程序

原文:https://www.cnblogs.com/heiyou-blog/p/9442344.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!