Skip to content

Commit 5bf6cc0

Browse files
committed
Update event-helpers.md
Deleted example of the `toggle()` method removed in jQuery 1.9, as discussed in issue jquery#382.
1 parent e0f2a74 commit 5bf6cc0

File tree

1 file changed

+0
-19
lines changed

1 file changed

+0
-19
lines changed

page/events/event-helpers.md

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -22,22 +22,3 @@ $( "#menu li" ).hover(function() {
2222
$( this ).toggleClass( "hover" );
2323
});
2424
```
25-
26-
### `.toggle()`
27-
28-
<div class="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-
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.
35-
36-
```
37-
// The toggle helper function
38-
$( "p.expander" ).toggle( function() {
39-
$( this ).prev().addClass( "open" );
40-
}, function() {
41-
$( this ).prev().removeClass( "open" );
42-
});
43-
```

0 commit comments

Comments
 (0)