title: canvas get points on mouse events
body: <p>I am having the following function to get the mouse click positions(coordinates).</p>
  
  <pre><code>$('#myCanvas').on('click', function(e) {
      event = e;
      event = event || window.event;
  
      var canvas = document.getElementById('myCanvas'),
              x = event.pageX - canvas.offsetLeft,
              y = event.pageY - canvas.offsetTop;
      alert(x + ' ' + y);
  });
  </code></pre>
  
  <p>I need to get the mouse point on clicking a position and also secound mouse point position after draging the same.</p>
  
  <p>ie.,
  mousedown point and mouseup points.</p>