Can't animate div


so, i'm trying to make my div animated only if i focus on my div+i hold a key....but it seems like my animate code doesn't work
what is the wrong part?

$(document).ready(function() {
  $('div').bind('keydown', function(event) {  
    switch(event.keyCode) {


Hi Kevinmogi,

You're missing a case statement inside your switch statement. If you want it to work for any key, you could probably just remove the switch part and leave only the $('div').animate(...); piece inside the function there.


This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.