2 개의 겹치는 div가 있고 둘 다에서 동일한 mousemove 이벤트가 실행되어야합니다. 버블 링 효과가있는 중첩 된 div를 사용할 수 없습니다. 어떻게 할 수 있습니까? 버블 링 효과가있는 중첩 된 div를 사용할 수 없습니다.
$(".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>
감사합니다.
$(".one").mousemove(function(){
console.log("something");
});
$(".two").mousemove(function(){
console.log("something else");
$(".one").mousemove();
});
.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;
opacity: .95;
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<div class="one">
Content one
</div>
<div class="two">
Content two
</div>
이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.
침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제
몇 마디 만하겠습니다