美文网首页
动态显示隐藏滚动条

动态显示隐藏滚动条

作者: 黄黄黄大帅 | 来源:发表于2021-10-09 15:11 被阅读0次
     const parent = document.querySelector(".EquipmentInspectionScroll");
        parent.addEventListener(
            "mouseenter",
            function (e) {
                e.target.style.overflowY = "auto";
            },
            false,
        );
    
        parent.addEventListener(
            "mouseleave",
            function (e) {
                e.target.style.overflowY = "hidden";
            },
            false,
        );
        parent.addEventListener(
            "scroll",
            function (e) {
                e.target.style.overflowY = "auto";
                setTimeout(()=>{
                    e.target.style.overflowY = "hidden";
                },3000)
            },
            false,
        );
    

    相关文章

      网友评论

          本文标题:动态显示隐藏滚动条

          本文链接:https://www.haomeiwen.com/subject/lypqoltx.html