zoukankan      html  css  js  c++  java
  • js禁止页面滚动

    1.申明函数:

    function preventBackgroundScroll(e: React.WheelEvent){
    const target = e.currentTarget
    if (
    (e.deltaY < 0 && target.scrollTop <= 0) ||
    (e.deltaY > 0 && target.scrollHeight - target.clientHeight - target.scrollTop <= 0)
    ) {
    e.stopPropagation()
    e.preventDefault()
    }
    }

    2.调用函数:
    <div onWheel = {this.state.lodding ? this.preventBackgroundScroll : null}>

    onWheel事件
查看全文
  • 相关阅读:
    20170719 Mysql 配置远端Mysql访问,增加表/存储过程
    20170720 Celery 异步任务处理到Sql Server 发生死锁
    20170718 关于Mysql 安装于虚拟机Ubuntu中,内网中Windows系统无法访问
    20170712 SQL Server 日志文件收索
    SQL Server 2016 发送邮件功能
    Sql server 函数--取值年月
    SSIS--(1)
    Hadoop 尝试
    百度之星复赛T6&&hd6149 ——Valley Numer II
    百度之星复赛T5&&hdu6148
  • 原文地址:https://www.cnblogs.com/wangrui38/p/8260210.html
  • Copyright © 2011-2022 走看看