Deprecated: Define .hover() using non-deprecated methods

Make the deprecated `.hover()` method not rely on other deprecated
methods: `.mouseenter()` & `.mouseleave()`. Use `.on()` instead.

Closes gh-5251
This commit is contained in:
Michał Gołębiowski-Owczarek 2023-05-22 18:23:19 +02:00 committed by GitHub
parent 6616acff0a
commit fd6ffc5eb2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -24,7 +24,9 @@ jQuery.fn.extend( {
},
hover: function( fnOver, fnOut ) {
return this.mouseenter( fnOver ).mouseleave( fnOut || fnOver );
return this
.on( "mouseenter", fnOver )
.on( "mouseleave", fnOut || fnOver );
}
} );