I have three boxes which on click animates to left+200.
But I would like the click animate to toggle so that when one box is animated, the other which was previously active gets back to default.i.e.left-0
I thought of one way but I don't know how to go about it:/
Create an empty Array.
On clicking box A add to Array and animate it.
If i click on box B, remove box A from and re-animate to default i.e.left-0 and add box B to Array and animate it.
Is this too far fetched/ possible?
I also thought of trying addClass & removeClass but since classes defined via CSS cannot be animated in jQuery(or I am ignorant), I couldn't do it.
Is it possible to create a selector/class for something in jQuery and apply that class to another selector?
For the same, is it possible to do the same by defining variables and create a function of the animation and pass the function onto the variable?
Please guide me.
Sorry for asking so many things.:///