Solved

toggle function in jQuery 1.9

Posted on 2013-05-25
2
619 Views
Last Modified: 2013-06-18
Hello Experts,

I understand that the toggle function is no longer used in jQuery 1.9.
I am trying to understand/search for the alternative function in 1.9 and i could not understand if there is a replacement function or do we have to work around it and make something that works.

For example, instead, i add a class once the button is clicked and then i check if the button has the "clicked" class ... if the button has not that class then for me its where i insert the toggle animation.

I just want to make sure that there is no alternative function to toggle before i use this method.

Thank you!
0
Comment
Question by:Refael
2 Comments
 
LVL 15

Accepted Solution

by:
Jagadishwor Dulal earned 500 total points
ID: 39197174
There is hasClass and addClass for the alternative of toggle. You can check them. Like your condition when you click a button you will add a class there. And if you want to to check if the class is already exist that will help by hasClass.
0
 

Author Closing Comment

by:Refael
ID: 39256923
The answer was quite obvious yet i thought there is a better resolution. Thank you for your comment :-)
0

Featured Post

MIM Survival Guide for Service Desk Managers

Major incidents can send mastered service desk processes into disorder. Systems and tools produce the data needed to resolve these incidents, but your challenge is getting that information to the right people fast. Check out the Survival Guide and begin bringing order to chaos.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this article you'll learn how to use Ajax calls within your CodeIgniter application. To explain this, I'll illustrate how to implement a simple contact form to allow visitors to send you an email through your web site.
Introduction Knockoutjs (Knockout) is a JavaScript framework (Model View ViewModel or MVVM framework).   The main ideology behind Knockout is to control from JavaScript how a page looks whilst creating an engaging user experience in the least …
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

840 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question