Hi, I''ve been working on new ideas for a JavaScript drag and drop library. I haven''t found a drag and drop library flexible enough for my needs and I think I have come up with something that is generally worthwhile. I use the DOM and Event utilities from Yahoo! UI and no Prototype.js. I''m interested in any ideas or suggestions people might have. Blog http://peter.michaux.ca/articles/2006/06/16/donut-dragdrop Examples http://peter.michaux.ca/examples/donut-dragdrop/donut-dragdrop.html http://peter.michaux.ca/examples/donut-dragdrop/scrollable.html http://peter.michaux.ca/examples/donut-dragdrop/slider.html Initial docs http://peter.michaux.ca/examples/donut-dragdrop/js_docs_out/index.html This is research code and some of it needs tidying or even refactoring. Some has a bit of polish already. The code is not free at the moment because I don''t think it is ready but I would like it available to people who think it is an interesting or useful idea. Peter
> I''ve been working on new ideas for a JavaScript drag and drop library. > I haven''t found a drag and drop library flexible enough for my needs > and I think I have come up with something that is generally > worthwhile. I use the DOM and Event utilities from Yahoo! UI and no > Prototype.js. I''m interested in any ideas or suggestions people might > have.Interesting approach. While reading your article, an idea occurred to me. Why not simply offset the dragged item to be a few pixels below the cursor as soon as the drag begins. Then you don''t have the empty box in the middle, you don''t need to create 4 divs, and you still get the benefit of triggering DOM events like you want. I had no idea that the dragdrop library worked like you wrote; that''s probably a major reason it gets really slow with a lot of droppables. Greg
On 6/29/06, Gregory Hill <Gregory_Hill-l9nu40+TWxQ@public.gmane.org> wrote:> http://peter.michaux.ca/articles/2006/06/16/donut-dragdrop > > Interesting approach. While reading your article, an idea occurred to > me. Why not simply offset the dragged item to be a few pixels below the > cursor as soon as the drag begins. Then you don''t have the empty box in > the middle, you don''t need to create 4 divs, and you still get the > benefit of triggering DOM events like you want.You certainly could do as you suggest and it was part of my prototyping. It may produce satisfactory user experience in some situations. The most important part is preserving the native browser events and avoiding looping. Peter
> You certainly could do as you suggest and it was part of my > prototyping. It may produce satisfactory user experience in some > situations. The most important part is preserving the native browser > events and avoiding looping.Well, what made you decide against it? Greg
On 6/29/06, Gregory Hill <Gregory_Hill-l9nu40+TWxQ@public.gmane.org> wrote:> > You certainly could do as you suggest and it was part of my > > prototyping. It may produce satisfactory user experience in some > > situations. The most important part is preserving the native browser > > events and avoiding looping. > > Well, what made you decide against it?Imagine dragging images in a page layout program where the images are dragged beside the cursor instead of under the cursor. It would make it very confusing where the final positioning will actually be. I think that the user would naturally be very confused.