> For the complete documentation index, see [llms.txt](https://mobius-studios.gitbook.io/selectable/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://mobius-studios.gitbook.io/selectable/api/events/drag.md).

# drag

Fires on `mousemove` / `touchmove`.

***

The callback has two parameters which returns the orignal event and coordinates of the selection area (lasso) as an `Object`.

```javascript
selectable.on("drag", function(e, coords) {

});
```

The `coords` parameter returns an `Object` of the following format:

```javascript
{
    x1: Number, // the origin x offset
    y1: Number, // the origin y offset
    x2: Number, // the x offset from x1
    y2: Number, // the y offset from y1
}
```

```
x1,y1 (origin)
      +----------------------+
      |                      |
      |                      |
      |                      |
      |                      |
      |                      |
      |                      |
      +----------------------+
                              x2, y2 (mouse pointer)
```
