From 5bf6cc080f3f57854cb35ea8d4cee048f8f201b0 Mon Sep 17 00:00:00 2001 From: Aurelio De Rosa Date: Mon, 7 Jul 2014 18:28:13 +0100 Subject: [PATCH] Update event-helpers.md Deleted example of the `toggle()` method removed in jQuery 1.9, as discussed in issue #382. --- page/events/event-helpers.md | 19 ------------------- 1 file changed, 19 deletions(-) diff --git a/page/events/event-helpers.md b/page/events/event-helpers.md index 2fad9c72..9fc2a1dd 100644 --- a/page/events/event-helpers.md +++ b/page/events/event-helpers.md @@ -22,22 +22,3 @@ $( "#menu li" ).hover(function() { $( this ).toggleClass( "hover" ); }); ``` - -### `.toggle()` - -
Note: This method signature was removed in jQuery 1.9. jQuery also provides an animation method named .toggle() that toggles the visibility of elements.
- -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. - -``` -// The toggle helper function -$( "p.expander" ).toggle( function() { - $( this ).prev().addClass( "open" ); -}, function() { - $( this ).prev().removeClass( "open" ); -}); -```