Solved

toggle function in jQuery 1.9

Posted on 2013-05-25
2
622 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

How to build a simple, quick and effective accordion menu using just 15 lines of jQuery and 2 css classes
Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
The viewer will learn the basics of jQuery, including how to invoke it on a web page. 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.: (CODE)
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…

749 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