title: Apply jQuery events to all class elements?
body: <p>I have the following code which will allowed a user running iOS to move a <code>&lt;div&gt;</code> with the class <code>.drag</code> around on the page. This works fine when there is one istance of <code>.drag</code>, but fails to work when there are two instances of it. Is it possible to have the code find all of the <code>&lt;div&gt;</code>'s, then allow them to be draggable?</p>
  
  <pre><code>var drag = $(".drag")[0];
      xPos = drag.offsetWidth / 2;
      yPos = drag.offsetHeight / 2;
      drag.addEventListener("touchmove", function() {
          event.preventDefault();
          $(this).css({
          'left' : event.targetTouches[0].pageX - xPos + 'px', 
          'top' : event.targetTouches[0].pageY - yPos + 'px'
      });
  });
  </code></pre>