Loop through keypress Jquery (case : 1; etc..) -
i have problem how maintain/continue loop if key pressed. figured animate page case 1 / case 2 / case 3 , case 4 know how continue loop if key pressed again (and again...). read loop here can't figure out. thanks in advance, here code : var counter = 0; $(document).bind('keydown', function(e) { if(e.which == 37 || e.which == 39) { counter++; switch(counter) { case 1: $('#maikeximu,#dossier').stop() .animate({ height: "toggle", }, 1200, function() { $('html,body').animate({ scrolltop: $("#maikeximu").next().offset().top }, 1000); }); break; case 2: $("#gal,#dossier, #viz").stop() .animate({ height: "toggle", ...