2つのオーバーラップするdivがあり、両方で同じmousemoveイベントを実行する必要があります。私はバブリング効果で入れ子divsを使用することはできません。 どうすればいいですか?私はバブリング効果で入れ子divsを使用することはできません。2つのオーバーラップするdivのmousemoveイベント
$(".one").mousemove(function(){
console.log("something")
})
$(".two").mousemove(function(){
console.log("something else")
})
.one{
background-color:red;
position:absolute;
left:0;
top:0;
width:100px;
height:100px;
}
.two{
color:blue;
position:absolute;
left:0;
top:0;
width:100px;
height:100px;
}
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
</head>
<body>
<script src="https://code.jquery.com/jquery-3.1.0.js"></script>
<div class="one">
Content one
</div>
<div class="two">
Content two
</div>
</body>
</html>
ありがとうございます。
あなたは他のdivのマウス移動イベント –