I'm trying some event bindings with jQuery and I have this simple code in my document ready:
$(document).ready(function() {
$("p a").each(function(i, selected){
$(selected).hover(
function(event) { alert('over: ' + event.type); },
function(event) { alert('out: ' + event.type); });
}
)
});
So, when I move mouse over a link thats inside a paragraph (selector is "p a") alerts pop-up twice. So, mouseenter and mouseleave are fired twice.
Can someone explain, why is this happening?
Thanks :)
EDIT: This only happens in Google Chrome. In IE7/FF3/Opera both events are fired only once.