收录日期:2019/04/18 21:06:18 时间:2010-06-22 20:16:48 标签:jquery,draggable,droppable

I am trying to show a $f00x$f00 grid (20x20 or 30x30 etc) (with gridlines) that an image can be dropped onto. I'm not sure how to get the grid to display does anyone have any ideas?

Implement this using a HTML5 Canvas:


  1. Layer your canvas on top of the container (a div element for example) that your image would be dropped onto such that the coordinates line up. I.E. the canvas directly overlaps your container.
  2. Make sure the canvas has a higher z-index than your image container.
  3. Draw your grid lines onto the Canvas