So I have this code:
$(document).ready(function() {
$(document).keypress(function(e)
{
switch(e.which)
{
// user presses the "a"
case 97: $('#character').css('left','+=40');
}
}
}
The problem is that I can only press "a" once and #character moves only once...
I also have jQuery draggable enabled (http://jqueryui.com/demos/draggable/) with a constrained area around it.
How come I can only move the div once with keypress?