我想在调用true
时收到mouseOver
,即使我们站在子节点上也是如此。
但是,如果我的光标停留在子false
节点上,我将获得span
。为什么这样?
// ... JS
mouseOver = e => {
console.log(target.hasAttribute('title') && target)
const closestLine = target.hasAttribute('title') && target
}
// ...JS
// ....html
<div onMouseOver={e => this.mouseOver(e)}>
<div class="imageWrap" title="Pack"> // mouseOver == true
<img src="medium.png"> // not responds on parent event
<span class="amount">78</span> // mouseOver == false
</div>
</div>
// ...html