html - Why I can't move an image by JQuery? -


i have tryed move image whi jquery, when press key on keyboard, doesn't work. problem?

here's code:

<html> <head> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script> <script>     $(document).ready(function(){         $(document).keydown(function(){             $(document).find("img").animate({                 top:"+=100px",             });         });     }); </script> </head> <body>     <img src="player.jpg"> </body> </html> 

thanks lot!

this thing should change:

<img style="position: relative" src="player.jpg"> 

Comments

Popular posts from this blog

c# - Unity IoC Lifetime per HttpRequest for UserStore -

Change the color of an oval at click in Java AWT -

I am trying to solve the error message 'incompatible ranks 0 and 1 in assignment' in a fortran 95 program. -