hi!
I want to toggle 5 side menus with the same class, but this code doesn't work really good. If I open and close each one after the next, its fine, but if I want to open the next during one is open, i have to click two times. (i know it's because of the variable-counter)
The problem is, that i have no clue if there is a better solution.
Thanks for your support!
- $(document).ready(function() {
-
- var number = 0;
-
- $('.side_lash').click(function(){
- if(number == 0){
- $(this).parent('.side_menu').animate({
- 'left':'0'
- });
-
- $('.side_menu').not($(this).parent('.side_menu')).animate({
- 'left':'-222'
- });
- number = 1;
- }
- else if(number == 1) {
- $(this).parent('.side_menu').animate({
- 'left':'-222'
- });
- number = 0;
- }
- });
- });