I started playing around with raphaeljs this week for a project I am working on. I need to utilize drag and drop and found there was limited support.
This is my attempt at extending that functionality: http://jsfiddle.net/xQFMK/ New raphaeljs functions * Raphael.el.getFirst: Get the first object * Raphael.el.getAll: Get all the graphical elements in an array * Raphael.el.intersects: Does your object intersect with object xy * Raphael.el.intersectsWith: Does your object intersect with any objects Drag class Functions and Events * dragStart: Fired when you start a drag operation * dragMove: Fired while you are moving your object * dragDone: Fired when you finish * dragOut: Fired when you un-hover an object The only thing you Should can call directly is: Drag.add(...); or Drag.add([obj1, obj2, obj3]); Multiple drag targets are supported, so if you drag an element onto one or more elements the drop events will tell you all the objects. This is still a work in progress but its stable enough for a preview. When I get the rest of the library finished I will put it on GitHub. As it stands, this library is written in Mootools but can be rewritten to support jQuery or whathave you. Any feedback would be appreciated! http://jsfiddle.net/xQFMK/
