So after reading a recently answered question i am unclear if i really understand the difference between the mouseenter()
and mouseover()
. The post
You see the behavior when your target element contains child elements:
http://jsfiddle.net/ZCWvJ/7/
Each time your mouse enters or leaves a child element, mouseover
is triggered, but not mouseenter
.
$('#my_div').bind("mouseover mouseenter", function(e) {
var el = $("#" + e.type);
var n = +el.text();
el.text(++n);
});
#my_div {
padding: 0 20px 20px 0;
background-color: #eee;
margin-bottom: 10px;
width: 90px;
overflow: hidden;
}
#my_div>div {
float: left;
margin: 20px 0 0 20px;
height: 25px;
width: 25px;
background-color: #aaa;
}
MouseEnter: 0
MouseOver: 0