jquery mouseout问题

trr*_*rrm 15 mouse jquery mouseout

我的HTML

<div id="parent">
<div id="child">cx</div>
</div>
Run Code Online (Sandbox Code Playgroud)

当我使用jquery

 $('#parent').mouseout(function(){
//something here
});
Run Code Online (Sandbox Code Playgroud)

我想知道为什么当我的鼠标进入子div时,函数会触发.我还在父母div里面.我希望只有当我离开父div而不是当我在任何子div上时才会触发mouseout函数

http://jsbin.com/esiju/ <<示例

干杯

jim*_*myi 26

这是mouseleave事件的目的.

$('#parent').mouseleave(function(){
//something here
});
Run Code Online (Sandbox Code Playgroud)

http://api.jquery.com/mouseleave/