Solved

toggle function in jQuery 1.9

Posted on 2013-05-25
2
637 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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
This article discusses how to implement server side field validation and display customized error messages to the client.
The viewer will learn how to dynamically set the form action using jQuery.
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)
Suggested Courses

623 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