Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialIliya Narsiya
3,387 PointsMy question about method .toggle().
Why we study method toggle() if he listed in API documentation as Deprecated?
2 Answers
Hugo Paz
15,622 PointsHI Ilya,
I believe you are confusing the methods, although they do have the same name. The .toggle() used in this video is an animation method and it is not deprecated.
There used to be another .toggle() but it was removed in jquery 1.9. Basically that method allowed you to do something when you clicked on an element and then if you clicked the element again, it would do something else.
Sean T. Unwin
28,690 PointsI don't see where it says "deprecated" on the reference page. Although, within the menu there is a "Deprecated" section for older versions of jQuery, however that is not related to the toggle()
documentation.
Iliya Narsiya
3,387 Pointsthank you for answer!
Iliya Narsiya
3,387 PointsIliya Narsiya
3,387 PointsHi Hugo Paz,
Simple, i saw this method in the list http://api.jquery.com/category/deprecated/ and thought that he outdated.
Hugo Paz
15,622 PointsHugo Paz
15,622 PointsI understand your confusion. They are different methods. The one you saw on the list was removed and a new one was added which does something different.
Iliya Narsiya
3,387 PointsIliya Narsiya
3,387 Pointsthank you for answer!