views:

250

answers:

3

I would like to implement some "Drag-select" functionality into a project of mine but i'm unsure how to implement it.

The creation of the selection area is not a problem, it's the capturing of elements within the area itself which is confusing me.

A: 

If you can use jquery there are some plugins that do this operation. Anyway you can check if the position of the element is contained into the selection area coordinates and, if it is, you select it.

mck89
A: 

Script.aculo.us has a nice implementation of drag-n-drop, but then you have to include this rather large library. Or you could investigate how they done it for that matter, since its open-source.

crunchdog
Thanks, but i'm already aware of the drag-n-drop functionality withing Script.aculo.us. I am already taking advantage of this to great the selection area itself, what i need to know is how i can capture any DOM elements within that capture area.
Phunky
+1  A: 

A jQuery example found here.

Selectable Demo

rahul
Thank you, i've not seen this example - will take a look at the source and see how they have implemented it.
Phunky