window.onscroll = function () {
    throttle(trrigerAdd,window);
};
function trrigerAdd(){
    var $dHeight = document.documentElement.clientHeight;
    var $aHeight = document.documentElement.offsetHeight;
    var $scrolly = document.documentElement.scrollTop || document.body.scrollTop;
    if (($aHeight - $dHeight) - $scrolly <= 2) {
        orderinfor.index[orderinfor.currentState]++;
    }
}
function throttle(method,context){
    clearTimeout(method.tId);
    console.log(method.tId);
    method.tId=setTimeout(function(){
        method.call(context);
    },500);

相关文章:

  • 2022-12-23
  • 2021-11-09
  • 2022-02-25
  • 2022-12-23
  • 2021-07-04
  • 2022-12-23
  • 2021-11-29
  • 2021-08-27
猜你喜欢
  • 2021-12-04
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-01-24
  • 2021-11-04
相关资源
相似解决方案