frontend/CSS&Design

[CSS] JS안쓰고 pointer-events 비활성화 시키기.

findTheValue 2021. 8. 18. 23:46

pointerEvents 쓰면 된다.

마우스 이벤트 특정상황에서 막고 싶을 때.

리액트 스타일에서도 쓸수있음.

 

style={
    type !== null
        ? type === "contest"
        ? { animation: "1s moveRight1 forwards" }
        : {
            animation: "1s fadeout forwards",
            pointerEvents: "none",
            }
        : {}
}