Fix inverted 'orig' and 'fix' event in mouseenter/mouseleave special events.

This commit is contained in:
lrbabe 2009-12-01 04:04:55 +08:00 committed by John Resig
parent 3afc6533e2
commit 2d27e053a0

View file

@ -538,15 +538,15 @@ delegate = function( event ) {
// Create mouseenter and mouseleave events // Create mouseenter and mouseleave events
jQuery.each({ jQuery.each({
mouseover: "mouseenter", mouseenter: "mouseover",
mouseout: "mouseleave" mouseleave: "mouseout"
}, function( orig, fix ) { }, function( orig, fix ) {
jQuery.event.special[ fix ] = { jQuery.event.special[ orig ] = {
setup: function(data){ setup: function(data){
jQuery.event.add( this, orig, data && data.selector ? delegate : withinElement, fix ); jQuery.event.add( this, fix, data && data.selector ? delegate : withinElement, orig );
}, },
teardown: function(data){ teardown: function(data){
jQuery.event.remove( this, orig, data && data.selector ? delegate : withinElement ); jQuery.event.remove( this, fix, data && data.selector ? delegate : withinElement );
} }
}; };
}); });