Skip to content

Commit

Permalink
Deprecated: Define .hover() using non-deprecated methods
Browse files Browse the repository at this point in the history
Make the deprecated `.hover()` method not rely on other deprecated
methods: `.mouseenter()` & `.mouseleave()`. Use `.on()` instead.

Closes gh-5251

(cherry picked from commit fd6ffc5)
  • Loading branch information
mgol committed May 22, 2023
1 parent b473729 commit 7287894
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/deprecated/event.js
Expand Up @@ -28,7 +28,9 @@ jQuery.fn.extend( {
},

hover: function( fnOver, fnOut ) {
return this.mouseenter( fnOver ).mouseleave( fnOut || fnOver );
return this
.on( "mouseenter", fnOver )
.on( "mouseleave", fnOut || fnOver );
}
} );

Expand Down

0 comments on commit 7287894

Please sign in to comment.