Actually, this is slightly faster, since the mouseenter function calls on (or trigger if called without an argument), as seen in the source code:
jQuery.each( ("blur focus focusin focusout load resize scroll unload click dblclick " + "mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave " + "change select submit keydown keypress keyup error contextmenu").split(" "), function( i, name ) { // Handle event binding jQuery.fn[ name ] = function( data, fn ) { return arguments.length > 0 ? this.on( name, null, data, fn ) : this.trigger( name ); }; });
As you can see, the same can be said for many events.
Personally, I prefer to use the mouseenter function (or click , etc.) when I do not need special on functions: one of the big advantages, in my opinion, in using jQuery is that it makes the code less verbose and more readable. And I donβt think you should be corrected, ask the guys who are correcting you why he does it.
source share