title: jQuery animation to make a png appear at a random point on the screen?
body: <p>Again, working on a Chrome extension here. This time, I'm looking to make a transparent png appear at a random place within the window. I feel like I could somehow use jQuery .animate() somehow? I would like to make the image appear somewhere random on the screen, <em>or</em> have it appear on top of a random element on the screen, be it text of an image etc. I have not an idea where to even begin. Any ideas? All input appreciated!
  EDIT: Here is my image.js file:</p>
  
  <pre><code>var image = "image";
  chrome.extension.getURL('image.png');
  $(document).ready(function(){
      randomlyMoveImage();
  });
  $("#image").css({
      "position": "absolute",
  });
  $("#image").attr("src", image.png);
  function randomlyMoveImage(){
      var width = $(document).width();
      var height = $(document).height();
  
      var x = Math.floor((Math.random() * width) + 1);
      var y = Math.floor((Math.random() * height) + 1);
      $( "#image" ).animate({
      left: x,
            top: y
  }, 0, function() {
      // Animation complete.
    });
  
      setTimeout(randomlyMoveImage, 3000);
  }
  $("#image").css({
      "position": "absolute",
  });
  </code></pre>
  
  <p>and here is my manifest.json:</p>
  
  <pre><code>{
    "manifest_version": 2,
  
    "name": "Animation",
    "description": "Animation",
    "version": "1.0",
    "web_accessible_resources": ["image.png"],
  
    "browser_action": {
      "default_icon": "image.png",
      "default_title": "Animation"
    },
    "content_scripts": [
          {
          "matches": ["http://*/*", "https://*/*"],
          "js": ["jquery.min.js"]
          }
      ],
    "background": {
    "scripts": ["extensionListener.js","audio.js"],
    "persistent": false
    },
    "permissions": [
      "activeTab",
      "https://ajax.googleapis.com/"
    ]
  }
  </code></pre>
  
  <p>Chrome inspect element returns that there is an error on image.js line 3, saying "$ is not defined". Any help is appreciated.</p>