You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
jQuery offers two event-related helper functions that save you a few keystrokes.
9
10
10
11
### `.hover()`
11
12
12
-
The [`.hover()`](http://api.jquery.com/hover/) method lets you pass one or two functions to be run when the
13
-
`mouseenter` and `mouseleave` events occur on an element. If you pass one
14
-
function, it will be run for both events; if you pass two functions, the first
15
-
will run for `mouseenter`, and the second will run for `mouseleave`.
13
+
The [`.hover()`](http://api.jquery.com/hover/) method lets you pass one or two functions to be run when the `mouseenter` and `mouseleave` events occur on an element. If you pass one function, it will be run for both events; if you pass two functions, the first will run for `mouseenter`, and the second will run for `mouseleave`.
16
14
17
15
**Note:** Prior to jQuery 1.4, the `.hover()` method required two functions.
<divclass="warning">Note: This method signature was removed in jQuery 1.9. jQuery also provides an animation method named .toggle() that toggles the visibility of elements.</div>
29
27
30
-
The [`.toggle()`](http://api.jquery.com/toggle-event/) method is triggered by the "click" event and accepts two or
31
-
more functions. Each time the click event occurs, the next function in the
32
-
list is called. Generally, `.toggle()` is used with just two functions;
33
-
however, it will accept an unlimited number of functions. Be careful, though:
34
-
providing a long list of functions can be difficult to debug.
28
+
The [`.toggle()`](http://api.jquery.com/toggle-event/) method is triggered by the "click" event and accepts two or more functions. Each time the click event occurs, the next function in the list is called. Generally, `.toggle()` is used with just two functions; however, it will accept an unlimited number of functions. Be careful, though: providing a long list of functions can be difficult to debug.
0 commit comments