aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMichał Gołębiowski-Owczarek <m.goleb@gmail.com>2023-05-22 18:23:19 +0200
committerGitHub <noreply@github.com>2023-05-22 18:23:19 +0200
commitfd6ffc5eb2c12562f2656d2f33865448420252be (patch)
tree0e0c2a88b942ace54b085ffed905e23f3af2c376 /src
parent6616acff0a6c144c3eac3afae8578085bd325834 (diff)
downloadjquery-fd6ffc5eb2c12562f2656d2f33865448420252be.tar.gz
jquery-fd6ffc5eb2c12562f2656d2f33865448420252be.zip
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
Diffstat (limited to 'src')
-rw-r--r--src/deprecated/event.js4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/deprecated/event.js b/src/deprecated/event.js
index 84ff5bad0..4f5c59c0a 100644
--- a/src/deprecated/event.js
+++ b/src/deprecated/event.js
@@ -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 );
}
} );