views:

54

answers:

5

In many browsers today you can click and drag images. Can I leverage this in any way? Could I receive an event when an image is dragged and dropped on top of another image in the same browser window?

+1  A: 

I guess you could do it easily with http://script.aculo.us/

I know it works for block elements, not sure about inline though

vrinek
+3  A: 

You could use the JQuery Draggable plugin.

darasd
I have seen that plug-in. Thanks! I was hoping for an easier way, but looks like you are right.
Jamey McElveen
+1  A: 

You could have a look at this DHTML library = DEMO & API

QuBaR
+1  A: 

I think this can be done by any Javascript framework (JQuery, Scriptaculous, MooTools, Dojo) as vrinek says. You could also cook up your own Javascript solution, but stable dragging and dropping routines are at the core of most frameworks.

I think whether an element is a block or inline doesn't really matter as you can set the properties for this as well in CSS.

mensch
+1  A: 

A number of browsers now support the Drag and Drop API, though not Internet Explorer, which (as usual) has its own way of doing things. If you're looking for a cross-browser solution that works today, one of the libraries is still your best bet.

NickFitz