unexpected onmouseout

222 views Asked by At

I have a gallery on "http://dev.moragues.pe/austral/es/#/nosotros/organizacion/gerencia/" I have registered two events

    jQuery('.ngg-gallery-thumbnail a img')
        .live('mouseover',function() {
    alert('a');
            jQuery(this).css('zIndex','100').addClass("hover").stop()
            .animate({
                top: '0',
                left: '0',
                width: '415px',
                height: '315px'
            }, 600);
        })
        .live('mouseout',function(){
    alert('b');
            it = jQuery(this).attr('initialTop');
            il = jQuery(this).attr('initialLeft');
            jQuery(this).removeClass("hover").stop()
            .animate({
                top: it,
                left: il,
                width: '105px',
                height: '80px'
            }, 600,function(){
jQuery(this).css('zIndex','0').addClass("hover").stop()
});
        });

But when I put the mouse over the div I see the alert('a'), the alert('b') and the alert('a') again but I just have passed the mouse (so I think it's just one event)

I happen in google chrome and Internet explorer. Does anyboy has any idea?

1

There are 1 answers

0
The Scrum Meister On

The issue only happens when using alert() which sets the focus on the alert box, causing the mouseover event to fire multiple times.

When i change the alert to console.log or some other action, it only fires once.