The solution is to use mouseenter
instead of mouseover
.
mouseenter
only triggers when the mouse enters the element on which it is set.
mouseover
triggers when the mouse enters the element or any of its children.
https://thisthat.dev/mouseenter-vs-mouseover/
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…