Phunky
Phunky

Reputation: 481

How to implement "Drag-Select" functionaility within Javascript?

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.

Upvotes: 1

Views: 1519

Answers (3)

rahul
rahul

Reputation: 187090

A jQuery example found here.

Selectable Demo

Upvotes: 1

crunchdog
crunchdog

Reputation: 13478

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.

Upvotes: 0

mck89
mck89

Reputation: 19241

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.

Upvotes: 0

Related Questions