zoukankan      html  css  js  c++  java
  • vue js 判断鼠标滚动到底部 数据更新

    1.监听鼠标滚动时间

    mounted() {
    window.addEventListener("scroll", this.handleScroll, true);
    },
    2.获取相关的高度 判断鼠标滚动到浏览器的底部
    handleScroll() {
    var scrollTop =
    document.documentElement.scrollTop || document.body.scrollTop; //变量windowHeight是可视区的高度
    var windowHeight =
    document.documentElement.clientHeight || document.body.clientHeight; //变量scrollHeight是滚动条的总高度
    var scrollHeight =
    document.documentElement.scrollHeight || document.body.scrollHeight;
    if (scrollTop + windowHeight == scrollHeight) {
    //请求数据接口
    // this.seeMoreSchoolList();
    return false;
    }
    },
     
     
  • 相关阅读:
    百斯特
    C++
    转载
    转载+整理
    转载
    转载
    转载
    C++
    转载
    CodeForces
  • 原文地址:https://www.cnblogs.com/zhengao/p/10493999.html
Copyright © 2011-2022 走看看