본문 바로가기

코딩도 합니다/JS

[자바스크립트 js] mouseenter / mouseleave VS mouseover / mouseout



  • mouseenter와 mouseleave는 버블링이 일어나지 않는다.
  • mouseenter와 mouseleave는 자식 요소의 영역을 계산하지 않는다.
  • 이벤트 핸들러가 자식 요소에까지 영향을 끼치게 하고 싶은 경우에는 mouseover/mouseout을 사용한다.
  • 자식 요소에는 영향을 끼치지 않고 해당 요소에만 이벤트 핸들러를 다루려면 mouseenter/mouseleave를 사용한다.
728x90