asimryu

마우스 포인터를 따라다니는 이미지

Sep 25th, 2014
336
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.45 KB | None | 0 0
  1. <!doctype html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8">
  5. <title>마우스 포인터를 따라다니는 이미지</title>
  6. </head>
  7. <body>
  8. <img id="image" src="http://lorempixel.com/50/50/animals" width="50" height="50" style="position:absolute;">
  9. <script src="http://code.jquery.com/jquery-1.11.1.js"></script>
  10. <script>
  11. $(document).mousemove(function(e){
  12. $("#image").stop().animate({left:e.pageX, top:e.pageY});
  13. });
  14. </script>
  15. </body>
  16. </html>
Advertisement
Add Comment
Please, Sign In to add comment