动态显示隐藏滚动条

 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,
    );

你可能感兴趣的:(动态显示隐藏滚动条)